Re: Constraint problem - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Constraint problem
Date
Msg-id GNELIHDDFBOCMGBFGEFOAEKECCAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: Constraint problem  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
What about using an intermediary value such as -1;

update foo set a = -1;
update foo set b = old a value;
update foo set a = old b value;

Sort of thing?

Chris

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org
> [mailto:pgsql-sql-owner@postgresql.org]On Behalf Of Josh Berkus
> Sent: Friday, 17 May 2002 3:30 AM
> To: Stephan Szabo
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] Constraint problem
>
>
>
> 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?
>
> --
> -Josh Berkus
>
> ______AGLIO DATABASE SOLUTIONS___________________________
>                                         Josh Berkus
>    Complete information technology     josh@agliodbs.com
>     and data management solutions     (415) 565-7293
>    for law firms, small businesses      fax 621-2533
>     and non-profit organizations.     San Francisco
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>



pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Constraint problem
Next
From: Masaru Sugawara
Date:
Subject: Re: how to build this list ?