From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Constraint problem
Date: Thu, 16 May 2002 13:39:19 -0700 (PDT)
Message-ID: <20020516132750.P93696-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <200205161230.23619.josh@agliodbs.com>
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.
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@megazone23.bigpanda.com, josh@agliodbs.com
Subject: Re: Constraint problem
In-Reply-To: <20020516132750.P93696-100000@megazone23.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