Re: Constraint problem - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Constraint problem
Date
Msg-id 20020516132750.P93696-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Constraint problem  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Constraint problem
List pgsql-sql
On Thu, 16 May 2002, Josh Berkus wrote:

>
> Stephan,
> > > I don't seem to be able to create a UNIQUE constraint as DEFERRABLE.  Is
> this
> > > not supported?
> >
> > Not currently.
>
> Hmm ... my workaround didn't work.   I need to impose a unique constraint on
> an INT column in a table, but make sure that the constraint isn't checked
> until the end of an UPDATE statement, so that I can swap values when I need
> to.
>
> How can I do this?

I unfortunately can't think of a good workaround. AFAICT, Unique should
wait until after all of the updates but our implementation doesn't
currently do so.

Hopefully someone will have some ideas, because the best I can think of
requires an additional full table scan to check uniqueness and the
concurrency issues would be a bear.




pgsql-sql by date:

Previous
From: "Joel Burton"
Date:
Subject: Re: SQL over my head...
Next
From: Gregory Brauer
Date:
Subject: Re: SQL over my head...