Re: Query Window: keep going after error

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Query Window: keep going after error
Дата
Msg-id 47AD94C5.4040504@iol.ie
обсуждение исходный текст
Ответ на Query Window: keep going after error  (Laurent Duperval <lduperval@yahoo.com>)
Список pgadmin-support
On 07/02/2008 15:30, Laurent Duperval wrote:

> I am currently testing some SQL scripts and I want to run the entire
> script, even if there is an error in it. Currently, it stops when there is
> an error and does not execute any of the commands in the SQL file.

At a guess, I'd say that this is because of the way PostgreSQL works, 
not PgAdmin - when you execute a series of statements within a 
transaction, and one of them causes an error, no following statements 
will be executed until you ROLLBACK the transaction. Scripts from from 
the Query Editor in PgAdmin are run within a transaction, so this is the 
behaviour you are seeing.

If you want your script to continue after an error (and to be honest I 
can't think of many cases where you would :-) ) you should run it from 
psql, perhaps using the \i command (which runs the contents of an 
external file).

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------


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

Предыдущее
От: Adam Taft
Дата:
Сообщение: Re: Timestamp Length or Precision Bug
Следующее
От: Mike Blackwell
Дата:
Сообщение: Character encoding conversion