Обсуждение: pg_dumpall ignores --globals-only
Hi folks... Can anyone else confirm this on 7.3.2? $ pg_dumpall --globals_only pg_dumpall: unrecognized option `--globals_only' Try 'pg_dumpall --help' for more information. -g works OK. I seem to recall this problem arising before. I've had confirmation that the problem exists in 7.3. -- Dan Langille : http://www.langille.org/
"Dan Langille" <dan@langille.org> writes: > $ pg_dumpall --globals_only > pg_dumpall: unrecognized option `--globals_only' There seems to be a bit of a disconnect between the code, the usage message, and the long_options table in pg_dumpall :-(. I'll see about cleaning it up, but in the meantime -g might work. regards, tom lane
"Dan Langille" <dan@langille.org> writes: > $ pg_dumpall --globals_only > pg_dumpall: unrecognized option `--globals_only' Looks like it's just a one-liner oversight. I'm not sure whether -g will work on your platform; if not, use the attached patch. regards, tom lane *** src/bin/pg_dump/pg_dumpall.c.orig Thu Jan 16 10:28:06 2003 --- src/bin/pg_dump/pg_dumpall.c Thu Mar 6 16:45:57 2003 *************** *** 77,82 **** --- 77,83 ---- {"inserts", no_argument, NULL, 'd'}, {"attribute-inserts", no_argument, NULL, 'D'}, {"column-inserts", no_argument, NULL, 'D'}, + {"globals-only", no_argument, NULL, 'g'}, {"host", required_argument, NULL, 'h'}, {"ignore-version", no_argument, NULL, 'i'}, {"oids", no_argument, NULL, 'o'},
On Thu, 2003-03-06 at 19:25, Dan Langille wrote: > Hi folks... > > Can anyone else confirm this on 7.3.2? > > $ pg_dumpall --globals_only In fact it should be "globals-only" (hyphen, not underscore), but even when spelt correctly it doesn't work. > pg_dumpall: unrecognized option `--globals_only' > Try 'pg_dumpall --help' for more information. > > -g works OK. > > I seem to recall this problem arising before. I've had confirmation > that the problem exists in 7.3. It doesn't work in 7.3.2. It doesn't work in CVS tip either. pg_dumpall.c needs an extra line in the long arguments definition: RCS file: /projects/cvsroot/pgsql-server/src/bin/pg_dump/pg_dumpall.c,v retrieving revision 1.14 diff -u -r1.14 pg_dumpall.c --- pg_dumpall.c 2003/02/14 19:40:42 1.14 +++ pg_dumpall.c 2003/03/06 22:06:25 @@ -81,6 +81,7 @@ {"inserts", no_argument, NULL, 'd'}, {"attribute-inserts", no_argument, NULL, 'D'}, {"column-inserts", no_argument, NULL, 'D'}, + {"globals-only", no_argument, NULL, 'g'}, {"host", required_argument, NULL, 'h'}, {"ignore-version", no_argument, NULL, 'i'}, {"oids", no_argument, NULL, 'o'}, -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "The LORD is my light and my salvation; whom shall I fear? the LORD is the strength of my life; of whom shall I be afraid?" Psalms 27:1
On Thu, 6 Mar 2003, Tom Lane wrote: > "Dan Langille" <dan@langille.org> writes: > > $ pg_dumpall --globals_only > > pg_dumpall: unrecognized option `--globals_only' > > There seems to be a bit of a disconnect between the code, the usage > message, and the long_options table in pg_dumpall :-(. I'll see > about cleaning it up, but in the meantime -g might work. Yes, -g did work for me.