strange "not deferrable" behaviour - Mailing list pgsql-sql

From Tomasz Myrta
Subject strange "not deferrable" behaviour
Date
Msg-id 3FB8D437.4050902@klaster.net
Whole thread Raw
Responses Re: strange "not deferrable" behaviour  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-sql
Hi

I've got some tables defined as:
create table xx (  some_column references master_table

It means this column is defined by default:
NOT DEFERRABLE, INITIALLY IMMEDIATE

I tried replacing rows in this table by new ones as:
set autocommit=off;
begin;
set constraints all deferred;
delete from ....
insert ...
insert...
commit;
I get "integrity violation"... just after "delete"

If I well understood manual, it works like it should. I'm not sure, 
because if I run this query in pgAdmin2, it works fine (why?) and 
replaces rows as needed.

When I drop this foreign key constraint (not too easy without a 
constraint name) and recreate it as "DEFERRABLE", this query works fine 
also in psql.

My question is: Why my query works fine when using pgAdmin, and it fails 
when using psql?

Regards,
Tomasz Myrta



pgsql-sql by date:

Previous
From: "cristi"
Date:
Subject: FATAL 2: PageIndexTupleDelete
Next
From: Yasir Malik
Date:
Subject: Re: Addition and subtraction on BIT type