multiple psql commands in batch

Поиск
Список
Период
Сортировка
От Tobias Boes
Тема multiple psql commands in batch
Дата
Msg-id 20060602182818.278260@gmx.net
обсуждение исходный текст
Ответы Re: multiple psql commands in batch  ("Daniel T. Staal" <DStaal@usa.net>)
Re: multiple psql commands in batch  ("Andrej Ricnik-Bay" <andrej.groups@gmail.com>)
Список pgsql-novice
G'Day all,

i know that this issues was discussed multiple time, but i still stuck in processing multiple pgsql commands in a DOS
batchfile. 
I want to create a user, than a database with the following command:
C:\financial-planner\pgsql\bin\psql.exe -U postgres  < create_user_and_db.sql

this scceeds. in the create_user_and_db.sql I stored the SQL-commands to setup the database and the database user.
but afterwards I want to switch to "mydatabase" and process the create table statements. In the pgsql shell I can
switchto "mydatabase" with the following command: 
\c mydatabase
but how can I run mulitple pgsql commands in a batch job? After loads of reading I'm still not able to do this.
Any help is really appreciated!
Thanks,
Tobias
--


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
      Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Locale and Initdb Errors
Следующее
От: "Daniel T. Staal"
Дата:
Сообщение: Re: multiple psql commands in batch