Fix data corruption bug reported by robjderr (#1010664).
pg_reorg broke catalog definition if the target table had any dropped columns. Now pg_reorg removes dropped columns and renumbers valid columns. You can use pg_reorg to shrink column definitions if you have many dropped columns. (without pg_reorg, dropped columns are filled with zero forever)
This commit is contained in:
@ -41,21 +41,4 @@ cstring_to_text(const char *s)
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
SPI_execute_with_args(const char *src,
|
||||
int nargs, Oid *argtypes,
|
||||
Datum *values, const char *nulls,
|
||||
bool read_only, long tcount)
|
||||
{
|
||||
SPIPlanPtr plan;
|
||||
int ret;
|
||||
|
||||
plan = SPI_prepare(src, nargs, argtypes);
|
||||
if (plan == NULL)
|
||||
return SPI_result;
|
||||
ret = SPI_execute_plan(plan, values, nulls, read_only, tcount);
|
||||
SPI_freeplan(plan);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -10,8 +10,6 @@
|
||||
#ifndef PGUT_BE_H
|
||||
#define PGUT_BE_H
|
||||
|
||||
#include "executor/spi.h"
|
||||
|
||||
#if PG_VERSION_NUM < 80300
|
||||
|
||||
#define PGDLLIMPORT DLLIMPORT
|
||||
@ -64,8 +62,6 @@ typedef void *BulkInsertState;
|
||||
|
||||
extern char *text_to_cstring(const text *t);
|
||||
extern text *cstring_to_text(const char *s);
|
||||
extern int SPI_execute_with_args(const char *src, int nargs, Oid *argtypes,
|
||||
Datum *values, const char *nulls, bool read_only, long tcount);
|
||||
|
||||
#define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s))
|
||||
#define TextDatumGetCString(d) text_to_cstring((text *) DatumGetPointer(d))
|
||||
|
Reference in New Issue
Block a user