Re: How to do an UPDATE for all the fields that do NOT break a constraint? - Mailing list pgsql-general

From Alban Hertroys
Subject Re: How to do an UPDATE for all the fields that do NOT break a constraint?
Date
Msg-id A3127A57-B559-4276-982B-A697012E04DA@solfertje.student.utwente.nl
Whole thread Raw
In response to How to do an UPDATE for all the fields that do NOT break a constraint?  (Phoenix Kiula <phoenix.kiula@gmail.com>)
List pgsql-general
On Jan 26, 2009, at 2:09 PM, Phoenix Kiula wrote:

> I wonder if this is an SQL limitation or something I'm missing in the
> PG manual, but I need to run an update on my database (to replace the
> value of a column to match a new design structure).


Easiest is probably to add a new column for the new values and add a
constraint to that, deprecating (or even dropping) the old column from
your design. Don't forget to vacuum afterwards.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.


!DSPAM:737,497f5540747032091416566!



pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Slow first query despite LIMIT and OFFSET clause
Next
From: Sam Mason
Date:
Subject: Re: performance advice needed: join vs explicit subselect