many sql file and one transaction

Поиск
Список
Период
Сортировка
От salah jubeh
Тема many sql file and one transaction
Дата
Msg-id 1318939882.80562.YahooMailNeo@web161516.mail.bf1.yahoo.com
обсуждение исходный текст
Ответы Re: many sql file and one transaction
Список pgsql-general
Hello,

I have many SQL script files to update schema, delete data, unit test ....etc.  I want to run all the files in one transaction using shell script to ease the installation procedure. I can do that from the psql client by using the \i option

BEGIN;
\i  / .../ module1.sql
\i  / .../ module2.sql
\i  / .../ module_etc.sql
COMMIT;

Is there a way to do that  using psql command  shell script. 

I.E.
I want to run the following  in one transaction, 
psql  -f  module1.sql
psql  -f  module2.sql
psql  -f  module_etc.sql
 


Thanks in advance

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

Предыдущее
От: Andre Lopes
Дата:
Сообщение: Re: How to correct: ERROR: permission denied: "RI_ConstraintTrigger_24966" is a system trigger
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: many sql file and one transaction