Re: [GENERAL] psql -l gives bad output - Mailing list pgsql-hackers

From Ron Snyder
Subject Re: [GENERAL] psql -l gives bad output
Date
Msg-id F888C30C3021D411B9DA00B0D0209BE803BB99EE@cvo-exchange.cvo.roguewave.com
Whole thread Raw
List pgsql-hackers
> >
> > But I recall a number of rounds of bug-fixes concerning quoting in
> > the pgsql shell scripts, so I'd not be surprised in the
> least to hear
> > that pre-7.2 PG releases get this wrong.  Or for that
> matter, we might
> > still have some problems in this line on some platforms with oddball
> > shells.  If you find that dropdb messes up with weird names in 7.2,
> > please send details about the test case and your platform...


RH 7.2; Postgres 7.2.1

bash-2.05$ BLAH='ab
> cd'
bash-2.05$ echo $BLAH
ab cd
bash-2.05$ echo "$BLAH"
ab
cd

[root@vault bin]# diff -c dropdb.orig dropdb
*** dropdb.orig Tue May 21 22:40:33 2002
--- dropdb      Tue May 21 22:40:46 2002
***************
*** 131,137 ****
  fi


! dbname=`echo $dbname | sed 's/\"/\\\"/g'`

  ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
  if [ "$?" -ne 0 ]; then
--- 131,137 ----
  fi


! dbname=`echo "$dbname" | sed 's/\"/\\\"/g'`

  ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\""
  if [ "$?" -ne 0 ]; then





pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Killing dead index tuples before they get vacuumed
Next
From: Shra
Date:
Subject: ...