Re: Update in all tables

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Update in all tables
Date: 2006-02-22 21:16:26
Message-ID: 1140642986.5777.39.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, 2006-02-22 at 15:13, Andrew Sullivan wrote:
> On Wed, Feb 22, 2006 at 11:59:06AM -0600, Judith Altamirano Figueroa wrote:
> > Hello everybody I need to update a field with the same value in the
> > tables of my data base but this field exists in almost all tables and
> > has the same value, I don't want to code a script, so my question is if
> > there is some way to update that field with a query and affects all the
> > tables that contain the field?
>
> No, sorry. While we're at it, though, if you have the same field in
> several tables, it's a good sign that your database is badly
> normalised. You shouldn't have to update more than one table (which
> is why there isn't a way to do this automatically).

Unless they're all FK/PK pairs, in which case you on update / delete
cascade FKs.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Owen Jacobson 2006-02-22 21:25:48 Re: Update in all tables
Previous Message Andrew Sullivan 2006-02-22 21:13:48 Re: Update in all tables