Thread: bug in clusterdb script
Hi There's a bug in the clusterdb script where it looks like the arguments to the psql command are being passed in the wrong order, so it fails when you run it on a database that is not on localhost. Here's the output from the command: 133 anands-Computer:bin/scripts> clusterdb -h wooster -U rr granada psql: warning: extra option wooster ignored psql: warning: extra option -U ignored psql: warning: extra option rr ignored psql: warning: extra option -F: ignored psql: warning: extra option -P ignored psql: warning: extra option format=unaligned ignored psql: warning: extra option -t ignored psql: warning: extra option -c ignored psql: warning: extra option SELECT nspname, pg_class.relname, pg_class_2.relname FROM pg_class, pg_class AS pg_class_2 JOIN pg_namespace ON (pg_namespace.oid=relnamespace), pg_index WHERE pg_class.oid=pg_index.indrelid AND pg_class_2.oid=pg_index.indexrelid AND pg_index.indisclustered AND pg_class.relowner=(SELECT usesysid FROM pg_user WHERE usename=current_user) ignored psql: FATAL: user "-h" does not exist I'm attaching a patch that fixes the problem. The diff was run on postgresql 7.3.4 Thanks a lot. Anand Ranganathan __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Attachment
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --------------------------------------------------------------------------- washingtonirving@yahoo.com wrote: > Hi There's a bug in the clusterdb script where it looks like the arguments > to the psql command are being passed in the wrong order, so it fails when > you run it on a database that is not on localhost. > Here's the output from the command: > > 133 anands-Computer:bin/scripts> clusterdb -h wooster -U rr granada > psql: warning: extra option wooster ignored > psql: warning: extra option -U ignored > psql: warning: extra option rr ignored > psql: warning: extra option -F: ignored > psql: warning: extra option -P ignored > psql: warning: extra option format=unaligned ignored > psql: warning: extra option -t ignored > psql: warning: extra option -c ignored > psql: warning: extra option SELECT nspname, pg_class.relname, > pg_class_2.relname FROM pg_class, pg_class AS pg_class_2 JOIN pg_namespace > ON (pg_namespace.oid=relnamespace), pg_index WHERE > pg_class.oid=pg_index.indrelid AND pg_class_2.oid=pg_index.indexrelid AND > pg_index.indisclustered AND pg_class.relowner=(SELECT usesysid FROM > pg_user WHERE usename=current_user) ignored > psql: FATAL: user "-h" does not exist > > > > I'm attaching a patch that fixes the problem. The diff was run on > postgresql 7.3.4 > > Thanks a lot. > Anand Ranganathan > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com Content-Description: clusterdb.patch [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
On Sat, Sep 27, 2003 at 08:02:17PM -0400, Bruce Momjian wrote: > > Your patch has been added to the PostgreSQL unapplied patches list at: > > http://momjian.postgresql.org/cgi-bin/pgpatches > > I will try to apply it within the next 48 hours. Keep in mind that this applies to the 7.3 branch only, because in 7.4 the script got reimplemented. -- Alvaro Herrera (<alvherre[a]dcc.uchile.cl>) "The Gord often wonders why people threaten never to come back after they've been told never to return" (www.actsofgord.com)
Patch applied to 7.3.X. Thanks. --------------------------------------------------------------------------- washingtonirving@yahoo.com wrote: > Hi There's a bug in the clusterdb script where it looks like the arguments > to the psql command are being passed in the wrong order, so it fails when > you run it on a database that is not on localhost. > Here's the output from the command: > > 133 anands-Computer:bin/scripts> clusterdb -h wooster -U rr granada > psql: warning: extra option wooster ignored > psql: warning: extra option -U ignored > psql: warning: extra option rr ignored > psql: warning: extra option -F: ignored > psql: warning: extra option -P ignored > psql: warning: extra option format=unaligned ignored > psql: warning: extra option -t ignored > psql: warning: extra option -c ignored > psql: warning: extra option SELECT nspname, pg_class.relname, > pg_class_2.relname FROM pg_class, pg_class AS pg_class_2 JOIN pg_namespace > ON (pg_namespace.oid=relnamespace), pg_index WHERE > pg_class.oid=pg_index.indrelid AND pg_class_2.oid=pg_index.indexrelid AND > pg_index.indisclustered AND pg_class.relowner=(SELECT usesysid FROM > pg_user WHERE usename=current_user) ignored > psql: FATAL: user "-h" does not exist > > > > I'm attaching a patch that fixes the problem. The diff was run on > postgresql 7.3.4 > > Thanks a lot. > Anand Ranganathan > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com Content-Description: clusterdb.patch [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073