Re: How to do an UPDATE for all the fields that do NOT break a constraint?

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to do an UPDATE for all the fields that do NOT break a constraint?
Date: 2009-01-27 18:41:02
Message-ID: A3127A57-B559-4276-982B-A697012E04DA@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-01-27 18:48:11 Re: performance advice needed: join vs explicit subselect
Previous Message Alban Hertroys 2009-01-27 18:37:22 Re: Slow first query despite LIMIT and OFFSET clause