clusterdb has poor error recovery

Started by Peter Eisentrautabout 23 years ago4 messages
#1Peter Eisentraut
peter_e@gmx.net

$ ./clusterdb
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
clusterdb: While clustering peter, the following failed:
$

This could probably handled a little more gracefully.

--
Peter Eisentraut peter_e@gmx.net

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Peter Eisentraut (#1)
1 attachment(s)
Re: [HACKERS] clusterdb has poor error recovery

On Sat, Oct 19, 2002 at 12:11:32AM +0200, Peter Eisentraut wrote:

$ ./clusterdb
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
clusterdb: While clustering peter, the following failed:
$

This could probably handled a little more gracefully.

Yes, sorry. A patch for this is attached. Please apply.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
XML! Exclaimed C++. What are you doing here? You're not a programming
language.
Tell that to the people who use me, said XML.

Attachments:

clusterdb-error.patchtext/plain; charset=us-asciiDownload
Index: src/bin/scripts/clusterdb
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/bin/scripts/clusterdb,v
retrieving revision 1.7
diff -c -r1.7 clusterdb
*** src/bin/scripts/clusterdb	2002/10/18 22:05:36	1.7
--- src/bin/scripts/clusterdb	2002/10/19 18:13:20
***************
*** 141,146 ****
--- 141,147 ----
  		exit 1
  	fi
  	dbname=`${PATHNAME}psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database WHERE datallowconn'`
+ 	[ "$?" -ne 0 ] && exit 1
  
  elif [ -z "$dbname" ]; then
  	if [ "$PGDATABASE" ]; then
***************
*** 159,164 ****
--- 160,166 ----
  	query="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)"
  	if [ -z "$table" ]; then
  		tables=`${PATHNAME}psql $db $PSQLOPT -F: -P format=unaligned -t -c "$query"`
+ 		[ "$?" -ne 0 ] && exit 1
  	else
  		# if tablename has a dot, use it as namespace separator
  		if echo $table | grep -s '\.' 2>&1 >/dev/null
#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Alvaro Herrera (#2)
Re: [HACKERS] clusterdb has poor error recovery

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.

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

Alvaro Herrera wrote:

On Sat, Oct 19, 2002 at 12:11:32AM +0200, Peter Eisentraut wrote:

$ ./clusterdb
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
clusterdb: While clustering peter, the following failed:
$

This could probably handled a little more gracefully.

Yes, sorry. A patch for this is attached. Please apply.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
XML! Exclaimed C++. What are you doing here? You're not a programming
language.
Tell that to the people who use me, said XML.

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.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
#4Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Alvaro Herrera (#2)
Re: [HACKERS] clusterdb has poor error recovery

Patch applied. Thanks.

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

Alvaro Herrera wrote:

On Sat, Oct 19, 2002 at 12:11:32AM +0200, Peter Eisentraut wrote:

$ ./clusterdb
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
clusterdb: While clustering peter, the following failed:
$

This could probably handled a little more gracefully.

Yes, sorry. A patch for this is attached. Please apply.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
XML! Exclaimed C++. What are you doing here? You're not a programming
language.
Tell that to the people who use me, said XML.

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.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