Re: Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Levchenko <sector119(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED
Date: 2009-12-09 18:10:07
Message-ID: 15623.1260382207@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Levchenko <sector119(at)gmail(dot)com> writes:
> Why I get: update or delete on table "people" violates foreign key
> constraint "transactions_person_id_fkey" on table "transactions"

> But before that query I run: SET CONSTRAINTS
> transactions_person_id_fkey DEFERRED; before delete from people table

It looks to me like it's doing what it is supposed to, ie, applying
the check at COMMIT.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message CG 2009-12-09 19:31:08 pg_dump and ON DELETE CASCADE problem
Previous Message Sergey Levchenko 2009-12-09 18:04:59 Problem with SET CONSTRAINTS some_constraint_fkey DEFERRED