pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Tomasz Myrta <jasiek@klaster.net>
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: strange "not deferrable" behaviour
Date: Mon, 17 Nov 2003 07:16:51 -0800 (PST)
Message-ID: <20031117071555.C94696@megazone.bigpanda.com> (raw)
In-Reply-To: <3FB8D437.4050902@klaster.net>
References: <3FB8D437.4050902@klaster.net>


On Mon, 17 Nov 2003, Tomasz Myrta wrote:

> 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?

Hmm, I'd suggest turning on query logging to make sure pgAdmin is doing
what you expect.



view thread (3+ messages)  latest in thread

Message-ID: <20031117071555.C94696@megazone.bigpanda.com>
Permalink:  ../20031117071555.C94696@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20031117071555.C94696@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, jasiek@klaster.net
  Subject: Re: strange "not deferrable" behaviour
  In-Reply-To: <20031117071555.C94696@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox