Hi, I have set of create table statements. I need to execute them at one go instead of running individual statement to create a table. Help !
Nageshwar - two tips for posting to the mailing lists
1. Don't reply to an existing message with a new question
2. Make sure the subject line describes your question.
Otherwise, many people won't notice your question and you'll get less people able to help.
As to the best way of executing multiple CREATE TABLE statements, that depends on whether you are using psql or some other client. With psql I'd put the statements in a file, then use something like:
psql -f my_commands.sql
psql < my_commands.sql
Or, if you're logged into psql you could use:
\i my_commands.sql
All covered in the man page for psql.
I always wrap the whole lot in BEGIN ... COMMIT so that if (usually when) I make a mistake it rolls back all the changes.
HTH -- Richard Huxton Archonet Ltd
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly