Re: More problem with scripts - Mailing list pgsql-hackers

From Brent Verner
Subject Re: More problem with scripts
Date
Msg-id 20020103185643.GA27503@rcfile.org
Whole thread Raw
In response to More problem with scripts  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: More problem with scripts
Re: More problem with scripts
List pgsql-hackers
[2002-01-03 13:12] Bruce Momjian said:
| Look at this:
| 
|     $ dropdb lijasdf oiuwqe test
|     DROP DATABASE
| 
| The create/drop scripts only process the last arguments, ignoring
| earlier ones.  I assume no one wants me to fix it now so I will add this
| to TODO:

something /simple/ might look like.

Index: dropdb
===================================================================
RCS file: /var/cvsup/pgsql/src/bin/scripts/dropdb,v
retrieving revision 1.13
diff -c -r1.13 dropdb
*** dropdb  30 Sep 2001 22:17:51 -0000  1.13
--- dropdb  3 Jan 2002 18:54:17 -0000
***************
*** 88,94 ****     exit 1     ;;    *)
!     dbname="$1"     ;;     esac     shift
--- 88,95 ----     exit 1     ;;    *)
!     [ ! -z "$dbname" ] && usage=1
!     dbname=$1     ;;     esac     shift
***************
*** 132,137 ****
--- 133,141 ----   dbname=`echo $dbname | sed 's/\"/\\\"/g'`
+ 
+ echo $dbname
+ exit 0;  ${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\"" if [ "$?" -ne 0 ]; then

-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Bulkloading using COPY - ignore duplicates?
Next
From: "Pavlo Baron"
Date:
Subject: Re: Smb to get involved