Rollback on include error in psql

Поиск
Список
Период
Сортировка
От Viktor Shitkovskiy
Тема Rollback on include error in psql
Дата
Msg-id CAK7FUCxR2cozA3ZTtPqUKgivFXBpPz=kJrfX6oWH5V5QtpnQBA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Rollback on include error in psql  (Melvin Davidson <melvin6925@gmail.com>)
Re: Rollback on include error in psql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Hello.

I'm trying to execute an sql script file in a single transation. The file contains includes for some other scripts which in my example create some tables. It looks like this:
    \include ../tables/table1.cre
    \include ../tables/table2.cre
    ...
    \include ../tables/table10.cre

I'm executing it using psql:
    psql -X --set AUTOCOMMIT=off --set ON_ERROR_STOP=on -e --single-transaction -d my_db -f my_script.sql

The problem is that errors with the include meta command do not cause a transactiopn rollback. e.g. if some of tableX.cre files is missing, any changes before its include will be commited. However, if there's some SQL syntax error, everyting works as expected.

Is it possible to somehow handle include related errors and rollback the active transcation?

I'm using PostgreSQL 9.2.1.

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

Предыдущее
От: Dan S
Дата:
Сообщение: Re: question about window function in C
Следующее
От: Ravi Kiran
Дата:
Сообщение: attaching a process in eclipse