diff options
| author | Bruce Momjian <bruce@momjian.us> | 2004-07-13 03:00:17 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2004-07-13 03:00:17 +0000 |
| commit | dc0e76ca36b4f7b91c3b83e53012585c5eccbe98 (patch) | |
| tree | b4f83c3908358ae84eacdcce38786812bfcffef7 /src/bin/pg_dump/pg_restore.c | |
| parent | e419c84c56a70d62ec267084ecf814bf132d0528 (diff) | |
| download | postgresql-dc0e76ca36b4f7b91c3b83e53012585c5eccbe98.tar.gz | |
Change pg_dump to use ALTER OWNER commands instead of SET SESSION
AUTHORIZATION commands by default. Move all GRANT and REVOKE commands
to the end of the dump to avoid restore failures in several situations.
Bring back --use-set-session-authorization option to get previous SET
behaviour
Christopher Kings-Lyne
Diffstat (limited to 'src/bin/pg_dump/pg_restore.c')
| -rw-r--r-- | src/bin/pg_dump/pg_restore.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 9b0dd312da..eef86a25e5 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -34,7 +34,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.58 2004/06/03 00:07:37 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_dump/pg_restore.c,v 1.59 2004/07/13 03:00:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -243,7 +243,7 @@ main(int argc, char **argv) case 'X': if (strcmp(optarg, "use-set-session-authorization") == 0) - /* no-op, still allowed for compatibility */ ; + use_setsessauth = 1; else if (strcmp(optarg, "disable-triggers") == 0) disable_triggers = 1; else @@ -286,6 +286,7 @@ main(int argc, char **argv) } opts->disable_triggers = disable_triggers; + opts->use_setsessauth = use_setsessauth; if (opts->formatName) { @@ -381,6 +382,9 @@ usage(const char *progname) printf(_(" -x, --no-privileges skip restoration of access privileges (grant/revoke)\n")); printf(_(" -X disable-triggers, --disable-triggers\n" " disable triggers during data-only restore\n")); + printf(_(" -X use-set-session-authorization, --use-set-session-authorization\n" + " use SESSION AUTHORIZATION commands instead of\n" + " OWNER TO commands\n")); printf(_("\nConnection options:\n")); printf(_(" -h, --host=HOSTNAME database server host or socket directory\n")); |
