Ledina Hido <[EMAIL PROTECTED]> 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

Reply via email to