Re: [ADMIN] sql scripts

2003-10-20 Thread Priya G
Use pg_dump -c this will drop the db objects before creating them Priya >From: Sam Carleton <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: [ADMIN] sql scripts >Date: Sat, 18 Oct 2003 22:37:00 -0400 > >I am new to postgres and your mailing lists, please let me know if I >am posting in th

Re: [ADMIN] sql scripts

2003-10-20 Thread Murthy Kambhampaty
If it's a bash script you could use: # SomeTable= TableTest=$(psql -d -U -ntc "select relname from pg_class where relname='$SomeTable'") [[ -n "$TableTest" ]] && psql -d -U -nc "drop table $SomeTable" # It's not quite "in postgres's sql", but it could get the job done >-Origina

Re: [ADMIN] sql scripts

2003-10-20 Thread David F. Skoll
On Sat, 18 Oct 2003, Sam Carleton wrote: > I am working on creating my first database in Postgres. In the > script that will create all the tables for the firs time, I would > like to have a conditional statement to delete a table, if it > already exists. As far as I know, there is no way to do