strange DEFERRABLE behaviour

From: Tomek <myrcioch(at)poczta(dot)onet(dot)pl>
To: Lista dyskusyjna pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: strange DEFERRABLE behaviour
Date: 2003-11-17 13:51:58
Message-ID: 3FB8D27E.7030000@poczta.onet.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-11-17 13:59:19 strange "not deferrable" behaviour
Previous Message cristi 2003-11-17 11:20:16 FATAL 2: PageIndexTupleDelete