Thread: pgAdmin III bug with transaction failure

pgAdmin III bug with transaction failure

From
RStefko@aol.com
Date:
I'm trying to run a SQL script in pgAdminIII which works in psql but fails in pgAdminIII
 
Platform:  XP Professional sp2
Language: English
Distribution: pgadmin3-win32.zip  12-Sep-2004 19:34
Version: 1.2.0 Post Beta 1 (Sep 12 2004)
 
Problem:
The script I'm running drops a table, then creates the table as separate transactions.
 
If the table does not exist when executing the DROP Table then I get an error "table 'xxx' does not exist' (which is OK with me) but the second transaction does not execute.
 
With PostgreSQL running in autocommit mode the separate transactions are implied, but I have also tried isolating the SQL DROP and CREATE statements in separate transactions.

Re: pgAdmin III bug with transaction failure

From
Andreas Pflug
Date:
RStefko@aol.com wrote:
> I'm trying to run a SQL script in pgAdminIII which works in psql but 
> fails in pgAdminIII
>  
> Platform:  XP Professional sp2
> Language: English
> Distribution: pgadmin3-win32.zip  12-Sep-2004 19:34
> Version: 1.2.0 Post Beta 1 (Sep 12 2004)
>  
> Problem:
> The script I'm running drops a table, then creates the table as separate 
> transactions.
>  
> If the table does not exist when executing the DROP Table then I get an 
> error "table 'xxx' does not exist' (which is OK with me) but the second 
> transaction does not execute.

This is normal pgsql behaviour. All statements are executed in a single 
batch/transaction. If one fails, the rest won't be executed.

You can mark the statements individually and execute them manually one 
by one.

Regards,
Andreas


Re: pgAdmin III bug with transaction failure

From
Andreas Pflug
Date:
RStefko@aol.com wrote:
> The default behavior in pgsql is to allow the use of transactions to 
> isolate SQL statements.  PgAdmin seems to batch the entire script into a 
> single transaction, making the user's transaction irrelevant.

Use the mailing list!

To pgAdmin, all you execute is a single statement. Execute them 
separately or use savepoints.

Regards,
Andreas