Re: Update violating constraint

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: Richard Huxton <dev(at)archonet(dot)com>, Naz Gassiep <naz(at)mira(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Update violating constraint
Date: 2007-05-03 15:24:01
Message-ID: 20070503152401.GG4218@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alban Hertroys wrote:
> Richard Huxton wrote:
> > Alban Hertroys wrote:
> >> Naz Gassiep wrote:
> >>> Hi,
> >>> I'm trying to do an update on a table that has a unique constraint
> >>> on the field, I need to update the table by setting field = field+1
> >
> >> I think you're looking for deferrable constraints; see:
> >>
> >> http://www.postgresql.org/docs/8.2/static/sql-set-constraints.html
> >
> > Which won't work with unique constraints unfortunately. That's because
> > they're implemented through a unique index.
>
> I appreciate the complexities involved, but that really ought to work on
> a single statement. I recall seeing something along these lines on the
> TODO list some time ago?

It is still on the TODO list. If you want it to disappear from there,
your best bet is implementing a fix, followed by motivating someone to
do it for you. If you don't, bets are someone will do it eventually
(which may be too late for your taste).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thorsten Kraus 2007-05-03 15:27:19 Re: Stored procedure
Previous Message Martin Gainty 2007-05-03 15:23:04 Re: C functions under windows