sql scripts
sql scripts
От:
Sam Carleton <ehc@linux-info.net>
Дата:
I am new to postgres and your mailing lists, please let me know if I am posting in the wrong list. 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. I know the other databases create such a condtional statement for you when you export the schema. What would such a conditional statement look like in Postgres's sql? sam
Re: sql scripts
От:
"David F. Skoll" <dfs@roaringpenguin.com>
Дата:
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 that in PostgreSQL's standard SQL language. But it doesn't matter -- as long as the DROP TABLE command is in it's own transaction, you can unconditionally drop the table and ignore any errors. Regards, David.
Re: sql scripts
От:
Murthy Kambhampaty <murthy.kambhampaty@goeci.com>
Дата:
If it's a bash script you could use: ##### SomeTable=
Re: sql scripts
От:
"Priya G" <sreepriya@hotmail.com>
Дата:
Use pg_dump -c
this will drop the db objects before creating them
Priya
Fretting that your Hotmail account may expire because you forgot to sign in enough? Get Hotmail Extra Storage today!