Search Postgresql Archives

Re: Transactions, Triggers and Error Messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ledina Hido <lh1101@xxxxxxxxxxxxxxx> writes:
> Now when I run the following (after inserting person with id=5 into  
> pers table):

> begin;
> set constraints all deferred;
> insert into tasks (pid, task) values (5, 'firstTask');
> insert into tasks (pid, task) values (5, 'secondTask');
> insert into tasks (pid, task) values (5, 'thirdTask');
> insert into tasks (pid, task) values (5, 'forthTask');
> insert into tasks (pid, task) values (5, 'fifthTask');
> commit;

> the transaction is correctly aborted but the error message I get is  
> not the one that raised the exception ie "3 tasks already exists for  
> person with pid 5" but the one from trying to insert the fifth task  
> (ie last statement) which is "ERROR:  current transaction is aborted,  
> commands ignored until end of transaction block"

What are you running this in?  ISTM this is a problem with bad structure
of client-side code, not something to be fixed on the server side.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux