Re: Query Window: keep going after error - Mailing list pgadmin-support

From Raymond O'Donnell
Subject Re: Query Window: keep going after error
Date
Msg-id 47AD94C5.4040504@iol.ie
Whole thread Raw
In response to Query Window: keep going after error  (Laurent Duperval <lduperval@yahoo.com>)
List 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 by date:

Previous
From: Adam Taft
Date:
Subject: Re: Timestamp Length or Precision Bug
Next
From: Mike Blackwell
Date:
Subject: Character encoding conversion