Fix memory leak and wrong usage of StringInfo in pgut_connect().

This commit is contained in:
Masahiko Sakamoto
2010-10-21 07:36:13 +00:00
parent 7865250a19
commit d8d39cc948
5 changed files with 96 additions and 13 deletions

View File

@ -75,7 +75,7 @@ static void RenameRelationInternal(Oid myrelid, const char *newrelname, Oid name
Datum
reorg_version(PG_FUNCTION_ARGS)
{
return CStringGetTextDatum("pg_reorg 1.1.2");
return CStringGetTextDatum("pg_reorg 1.1.5");
}
/**
@ -605,7 +605,7 @@ remove_dropped_columns_and_adjust_attnum(Oid oid, int16 natts1, int16 natts2)
natts2 - natts1, SPI_processed);
/* renumber attnum */
#if PG_VERSION_NUM >= 80500
#if PG_VERSION_NUM >= 90000
execute_with_format(SPI_OK_UPDATE,
"UPDATE pg_catalog.pg_attribute m"
" SET attnum = (SELECT count(*) FROM pg_attribute a"
@ -802,7 +802,7 @@ reorg_swap(PG_FUNCTION_ARGS)
/* adjust key attnum if the target table has dropped columns */
if (natts1 != natts2)
{
#if PG_VERSION_NUM >= 80500
#if PG_VERSION_NUM >= 90000
execute_with_format(SPI_OK_UPDATE,
"UPDATE pg_catalog.pg_index m SET indkey = n.indkey"
" FROM pg_catalog.pg_index n"