Re: Unable To Modify Table

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: "PostgreSQL (SQL)" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Unable To Modify Table
Date: 2012-01-12 16:53:47
Message-ID: 4F0F101B.5050105@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 01/12/2012 08:42 AM, Carlos Mennens wrote:
> I seem to have an issue where I can't modify a table due to another
> tables foreign key association:
>
> ...
>
> How does one accomplish my goal? Is this difficult to change or once
> that foreign key is created, are you stuck with that particular
> constraint?
>

Try updating the values in both tables within a transaction with
constraints set to deferred:
http://www.postgresql.org/docs/current/static/sql-set-constraints.html

Cheers,
Steve

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2012-01-12 16:54:41 Re: Unable To Modify Table
Previous Message Carlos Mennens 2012-01-12 16:42:59 Unable To Modify Table