Fix ownership bug.

New toast table, toast index, and toast type should not have
been owned by the executor of pg_reorg, but by the original owner.
This commit is contained in:
Takahiro Itagaki
2009-05-14 08:19:25 +00:00
parent 0c659ed31f
commit 9a8f2e9c33
7 changed files with 424 additions and 246 deletions

View File

@ -1,56 +1,61 @@
/*
/*-------------------------------------------------------------------------
*
* pgut.h
*
* Copyright (c) 2009, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
*
*-------------------------------------------------------------------------
*/
#ifndef PGUT_H
#define PGUT_H
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#include <getopt.h>
#if !defined(C_H) && !defined(__cplusplus)
#ifndef bool
typedef char bool;
#endif
#ifndef true
#define true ((bool) 1)
#endif
#ifndef false
#define false ((bool) 0)
#endif
#endif
/*
* pgut client variables and functions
*/
extern const char *pgut_optstring;
extern const struct option pgut_longopts[];
extern pqbool pgut_argument(int c, const char *arg);
extern int pgut_help(void);
extern int pgut_version(void);
extern void pgut_cleanup(pqbool fatal);
/*
* exit codes
*/
#define EXITCODE_OK 0 /**< normal exit */
#define EXITCODE_ERROR 1 /**< normal error */
#define EXITCODE_HELP 2 /**< help and version mode */
#define EXITCODE_FATAL 3 /**< fatal error */
extern bool pgut_argument(int c, const char *arg);
extern void pgut_help(void);
extern void pgut_cleanup(bool fatal);
/*
* pgut framework variables and functions
*/
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
extern const char *PROGRAM_NAME;
extern const char *PROGRAM_VERSION;
extern const char *PROGRAM_URL;
extern const char *PROGRAM_EMAIL;
extern const char *progname;
extern const char *dbname;
extern char *host;
extern char *port;
extern char *username;
extern pqbool password;
extern pqbool interrupted;
extern PGconn *current_conn;
extern const char *host;
extern const char *port;
extern const char *username;
extern bool password;
extern int pgut_getopt(int argc, char **argv);
extern PGconn *connection;
extern void parse_options(int argc, char **argv);
extern bool assign_option(const char **value, int c, const char *arg);
extern void reconnect(void);
extern void disconnect(void);
@ -62,4 +67,40 @@ extern void command(const char *query, int nParams, const char **params);
extern unsigned int sleep(unsigned int seconds);
#endif
/*
* elog
*/
#define LOG (-4)
#define INFO (-3)
#define NOTICE (-2)
#define WARNING (-1)
#define ERROR 1
#define HELP 2
#define FATAL 3
#define PANIC 4
#undef elog
extern void
elog(int elevel, const char *fmt, ...)
__attribute__((format(printf, 2, 3)));
/*
* StringInfo
*/
#define StringInfoData PQExpBufferData
#define StringInfo PQExpBuffer
#define makeStringInfo createPQExpBuffer
#define initStringInfo initPQExpBuffer
#define freeStringInfo destroyPQExpBuffer
#define termStringInfo termPQExpBuffer
#define resetStringInfo resetPQExpBuffer
#define enlargeStringInfo enlargePQExpBuffer
/*
#define printfPQExpBuffer = resetStringInfo + appendStringInfo
*/
#define appendStringInfo appendPQExpBuffer
#define appendStringInfoString appendPQExpBufferStr
#define appendStringInfoChar appendPQExpBufferChar
#define appendBinaryStringInfo appendBinaryPQExpBuffer
#endif /* PGUT_H */