Re: add missing options to pg_dumpall

Lists: pgsql-patches
From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Cc: mm-mailinglist(at)madness(dot)at
Subject: add missing options to pg_dumpall
Date: 2004-06-25 06:39:09
Message-ID: 40DBC88D.4080406@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hi,

This patch adds the following options to pg_dumpall, to be passed to
pg_dump:

-S, --superuser=NAME

-O, --no-owner

-X disable-dollar-quoting, --disable-dollar-quoting

-X disable-triggers, --disable-triggers

Chris

Attachment Content-Type Size
pg_dumpall.txt.gz application/x-gzip 2.7 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>, mm-mailinglist(at)madness(dot)at
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-12 14:35:54
Message-ID: 200407121435.i6CEZsP13483@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:
> Hi,
>
> This patch adds the following options to pg_dumpall, to be passed to
> pg_dump:
>
> -S, --superuser=NAME
>
> -O, --no-owner
>
> -X disable-dollar-quoting, --disable-dollar-quoting
>
> -X disable-triggers, --disable-triggers
>
> Chris
>

[ application/x-gzip is not supported, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Stefan Kaltenbrunner <mm-mailinglist(at)madness(dot)at>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-14 18:18:01
Message-ID: 40F578D9.9000600@madness.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian wrote:
> Patch applied. Thanks.

thanks - that's wonderful news :-)

However the patch as it went in has a minor cosmetic issues with the
display of the --help output.
Maybe something like the attached patch should be applied to restore
the alphabetical option ordering and make the output more like the
pg_dump output.

Stefan

Attachment Content-Type Size
pg_dumpall_help_order_fix.diff text/plain 2.7 KB

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Stefan Kaltenbrunner <mm-mailinglist(at)madness(dot)at>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-15 01:27:17
Message-ID: 40F5DD75.7010901@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hmmm, and I need to resurrect the -X use-set-session-authorization flag
for pg_dumpall as well...patch coming soon...

Chris

Stefan Kaltenbrunner wrote:

> Bruce Momjian wrote:
>
>> Patch applied. Thanks.
>
>
> thanks - that's wonderful news :-)
>
> However the patch as it went in has a minor cosmetic issues with the
> display of the --help output.
> Maybe something like the attached patch should be applied to restore the
> alphabetical option ordering and make the output more like the pg_dump
> output.
>
>
> Stefan
>
>
> ------------------------------------------------------------------------
>
> Index: src/bin/pg_dump/pg_dumpall.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
> retrieving revision 1.44
> diff -u -r1.44 pg_dumpall.c
> --- src/bin/pg_dump/pg_dumpall.c 12 Jul 2004 14:35:45 -0000 1.44
> +++ src/bin/pg_dump/pg_dumpall.c 14 Jul 2004 17:56:04 -0000
> @@ -310,26 +310,26 @@
> printf(_("Usage:\n"));
> printf(_(" %s [OPTION]...\n"), progname);
>
> - printf(_("\nOptions:\n"));
> + printf(_("\nGeneral options:\n"));
> + printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> + " pg_dumpall version\n"));
> + printf(_(" --help show this help, then exit\n"));
> + printf(_(" --version output version information, then exit\n"));
> + printf(_("\nOptions controlling the output content:\n"));
> printf(_(" -a, --data-only dump only the data, not the schema\n"));
> printf(_(" -c, --clean clean (drop) databases prior to create\n"));
> printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
> printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
> printf(_(" -g, --globals-only dump only global objects, no databases\n"));
> - printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> - " pg_dumpall version\n"));
> - printf(_(" -s, --schema-only dump only the schema, no data\n"));
> - printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -o, --oids include OIDs in dump\n"));
> printf(_(" -O, --no-owner do not output commands to set object ownership\n"));
> - printf(_(" -v, --verbose verbose mode\n"));
> + printf(_(" -s, --schema-only dump only the schema, no data\n"));
> + printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
> printf(_(" -X disable-dollar-quoting, --disable-dollar-quoting\n"
> " disable dollar quoting, use SQL standard quoting\n"));
> printf(_(" -X disable-triggers, --disable-triggers\n"
> - " disable triggers during data-only restore\n"));
> - printf(_(" --help show this help, then exit\n"));
> - printf(_(" --version output version information, then exit\n"));
> + " disable triggers during data-only restore\n"));
>
> printf(_("\nConnection options:\n"));
> printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stefan Kaltenbrunner <mm-mailinglist(at)madness(dot)at>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-15 15:20:28
Message-ID: 200407151520.i6FFKSJ02014@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Stefan Kaltenbrunner wrote:
> Bruce Momjian wrote:
> > Patch applied. Thanks.
>
> thanks - that's wonderful news :-)
>
> However the patch as it went in has a minor cosmetic issues with the
> display of the --help output.
> Maybe something like the attached patch should be applied to restore
> the alphabetical option ordering and make the output more like the
> pg_dump output.
>
>
> Stefan

> Index: src/bin/pg_dump/pg_dumpall.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
> retrieving revision 1.44
> diff -u -r1.44 pg_dumpall.c
> --- src/bin/pg_dump/pg_dumpall.c 12 Jul 2004 14:35:45 -0000 1.44
> +++ src/bin/pg_dump/pg_dumpall.c 14 Jul 2004 17:56:04 -0000
> @@ -310,26 +310,26 @@
> printf(_("Usage:\n"));
> printf(_(" %s [OPTION]...\n"), progname);
>
> - printf(_("\nOptions:\n"));
> + printf(_("\nGeneral options:\n"));
> + printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> + " pg_dumpall version\n"));
> + printf(_(" --help show this help, then exit\n"));
> + printf(_(" --version output version information, then exit\n"));
> + printf(_("\nOptions controlling the output content:\n"));
> printf(_(" -a, --data-only dump only the data, not the schema\n"));
> printf(_(" -c, --clean clean (drop) databases prior to create\n"));
> printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
> printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
> printf(_(" -g, --globals-only dump only global objects, no databases\n"));
> - printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> - " pg_dumpall version\n"));
> - printf(_(" -s, --schema-only dump only the schema, no data\n"));
> - printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -o, --oids include OIDs in dump\n"));
> printf(_(" -O, --no-owner do not output commands to set object ownership\n"));
> - printf(_(" -v, --verbose verbose mode\n"));
> + printf(_(" -s, --schema-only dump only the schema, no data\n"));
> + printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
> printf(_(" -X disable-dollar-quoting, --disable-dollar-quoting\n"
> " disable dollar quoting, use SQL standard quoting\n"));
> printf(_(" -X disable-triggers, --disable-triggers\n"
> - " disable triggers during data-only restore\n"));
> - printf(_(" --help show this help, then exit\n"));
> - printf(_(" --version output version information, then exit\n"));
> + " disable triggers during data-only restore\n"));
>
> printf(_("\nConnection options:\n"));
> printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stefan Kaltenbrunner <mm-mailinglist(at)madness(dot)at>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-15 15:20:37
Message-ID: 200407151520.i6FFKbq02021@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

\Stefan Kaltenbrunner wrote:
> Bruce Momjian wrote:
> > Patch applied. Thanks.
>
> thanks - that's wonderful news :-)
>
> However the patch as it went in has a minor cosmetic issues with the
> display of the --help output.
> Maybe something like the attached patch should be applied to restore
> the alphabetical option ordering and make the output more like the
> pg_dump output.
>
>
> Stefan

> Index: src/bin/pg_dump/pg_dumpall.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
> retrieving revision 1.44
> diff -u -r1.44 pg_dumpall.c
> --- src/bin/pg_dump/pg_dumpall.c 12 Jul 2004 14:35:45 -0000 1.44
> +++ src/bin/pg_dump/pg_dumpall.c 14 Jul 2004 17:56:04 -0000
> @@ -310,26 +310,26 @@
> printf(_("Usage:\n"));
> printf(_(" %s [OPTION]...\n"), progname);
>
> - printf(_("\nOptions:\n"));
> + printf(_("\nGeneral options:\n"));
> + printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> + " pg_dumpall version\n"));
> + printf(_(" --help show this help, then exit\n"));
> + printf(_(" --version output version information, then exit\n"));
> + printf(_("\nOptions controlling the output content:\n"));
> printf(_(" -a, --data-only dump only the data, not the schema\n"));
> printf(_(" -c, --clean clean (drop) databases prior to create\n"));
> printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
> printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
> printf(_(" -g, --globals-only dump only global objects, no databases\n"));
> - printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> - " pg_dumpall version\n"));
> - printf(_(" -s, --schema-only dump only the schema, no data\n"));
> - printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -o, --oids include OIDs in dump\n"));
> printf(_(" -O, --no-owner do not output commands to set object ownership\n"));
> - printf(_(" -v, --verbose verbose mode\n"));
> + printf(_(" -s, --schema-only dump only the schema, no data\n"));
> + printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
> printf(_(" -X disable-dollar-quoting, --disable-dollar-quoting\n"
> " disable dollar quoting, use SQL standard quoting\n"));
> printf(_(" -X disable-triggers, --disable-triggers\n"
> - " disable triggers during data-only restore\n"));
> - printf(_(" --help show this help, then exit\n"));
> - printf(_(" --version output version information, then exit\n"));
> + " disable triggers during data-only restore\n"));
>
> printf(_("\nConnection options:\n"));
> printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Stefan Kaltenbrunner <mm-mailinglist(at)madness(dot)at>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-15 15:21:05
Message-ID: 200407151521.i6FFL5M02141@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Oops, patch coming from Christopher. Removed.

---------------------------------------------------------------------------

Stefan Kaltenbrunner wrote:
> Bruce Momjian wrote:
> > Patch applied. Thanks.
>
> thanks - that's wonderful news :-)
>
> However the patch as it went in has a minor cosmetic issues with the
> display of the --help output.
> Maybe something like the attached patch should be applied to restore
> the alphabetical option ordering and make the output more like the
> pg_dump output.
>
>
> Stefan

> Index: src/bin/pg_dump/pg_dumpall.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v
> retrieving revision 1.44
> diff -u -r1.44 pg_dumpall.c
> --- src/bin/pg_dump/pg_dumpall.c 12 Jul 2004 14:35:45 -0000 1.44
> +++ src/bin/pg_dump/pg_dumpall.c 14 Jul 2004 17:56:04 -0000
> @@ -310,26 +310,26 @@
> printf(_("Usage:\n"));
> printf(_(" %s [OPTION]...\n"), progname);
>
> - printf(_("\nOptions:\n"));
> + printf(_("\nGeneral options:\n"));
> + printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> + " pg_dumpall version\n"));
> + printf(_(" --help show this help, then exit\n"));
> + printf(_(" --version output version information, then exit\n"));
> + printf(_("\nOptions controlling the output content:\n"));
> printf(_(" -a, --data-only dump only the data, not the schema\n"));
> printf(_(" -c, --clean clean (drop) databases prior to create\n"));
> printf(_(" -d, --inserts dump data as INSERT, rather than COPY, commands\n"));
> printf(_(" -D, --column-inserts dump data as INSERT commands with column names\n"));
> printf(_(" -g, --globals-only dump only global objects, no databases\n"));
> - printf(_(" -i, --ignore-version proceed even when server version mismatches\n"
> - " pg_dumpall version\n"));
> - printf(_(" -s, --schema-only dump only the schema, no data\n"));
> - printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -o, --oids include OIDs in dump\n"));
> printf(_(" -O, --no-owner do not output commands to set object ownership\n"));
> - printf(_(" -v, --verbose verbose mode\n"));
> + printf(_(" -s, --schema-only dump only the schema, no data\n"));
> + printf(_(" -S, --superuser=NAME specify the superuser user name to use in the dump\n"));
> printf(_(" -x, --no-privileges do not dump privileges (grant/revoke)\n"));
> printf(_(" -X disable-dollar-quoting, --disable-dollar-quoting\n"
> " disable dollar quoting, use SQL standard quoting\n"));
> printf(_(" -X disable-triggers, --disable-triggers\n"
> - " disable triggers during data-only restore\n"));
> - printf(_(" --help show this help, then exit\n"));
> - printf(_(" --version output version information, then exit\n"));
> + " disable triggers during data-only restore\n"));
>
> printf(_("\nConnection options:\n"));
> printf(_(" -h, --host=HOSTNAME database server host or socket directory\n"));

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-16 09:57:01
Message-ID: 40F7A66D.1020701@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

OK,

Here is another patch that fixes a stack of pg_dump bugs:

* Fix help text ordering

* Add back --set-session-authorization to pg_dumpall. Updated the docs
for that. Updated help for that.

* Dump ALTER USER commands for the cluster owner ("pgsql"). These are
dumped AFTER the create user and create database commands in case the
permissions to do these have been revoked.

* Dump ALTER OWNER for public schema (because it's possible to change
it). This was done by adding TOC entries for the public schema, and
filtering them out at archiver time. I also save the owner in the TOC
entry just for the public schema.

* Suppress dumping single quotes around schema_path and DateStyle
options when they are set using ALTER USER or ALTER DATABASE. Added a
comment to the steps in guc.c to remind people to update that list.

* Fix dumping in --clean mode against a pre-7.3 server. It just sets
all drop statements to assume the public schema, allowing it to restore
without error.

* Cleaned up text output. eg. Don't output -- Tablespaces comment if
there are none. Same for groups and users.

* Make the commands to DELETE FROM pg_shadow and DELETE FROM pg_group
only be output when -c mode is enabled. I'm not sure why that hasn't
been done before?!?!

This should be good for application asap, after which I will start on
regression dumping 7.0-7.4 databases.

Chris

Attachment Content-Type Size
pg_dump_fixes3.txt.gz application/x-gzip 4.1 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add missing options to pg_dumpall
Date: 2004-07-19 21:38:00
Message-ID: 200407192138.i6JLc0E06374@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied. Thanks.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:
> OK,
>
> Here is another patch that fixes a stack of pg_dump bugs:
>
> * Fix help text ordering
>
> * Add back --set-session-authorization to pg_dumpall. Updated the docs
> for that. Updated help for that.
>
> * Dump ALTER USER commands for the cluster owner ("pgsql"). These are
> dumped AFTER the create user and create database commands in case the
> permissions to do these have been revoked.
>
> * Dump ALTER OWNER for public schema (because it's possible to change
> it). This was done by adding TOC entries for the public schema, and
> filtering them out at archiver time. I also save the owner in the TOC
> entry just for the public schema.
>
> * Suppress dumping single quotes around schema_path and DateStyle
> options when they are set using ALTER USER or ALTER DATABASE. Added a
> comment to the steps in guc.c to remind people to update that list.
>
> * Fix dumping in --clean mode against a pre-7.3 server. It just sets
> all drop statements to assume the public schema, allowing it to restore
> without error.
>
> * Cleaned up text output. eg. Don't output -- Tablespaces comment if
> there are none. Same for groups and users.
>
> * Make the commands to DELETE FROM pg_shadow and DELETE FROM pg_group
> only be output when -c mode is enabled. I'm not sure why that hasn't
> been done before?!?!
>
> This should be good for application asap, after which I will start on
> regression dumping 7.0-7.4 databases.
>
> Chris
>

[ application/x-gzip is not supported, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073