pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Update in all tables
Date: Wed, 22 Feb 2006 15:16:26 -0600
Message-ID: <1140642986.5777.39.camel@state.g2switchworks.com> (raw)
In-Reply-To: <20060222211348.GE8741@phlogiston.dyndns.org>
References: <1140631146.5580.5.camel@Desarrollo>
	<20060222211348.GE8741@phlogiston.dyndns.org>

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.



view thread (7+ messages)  latest in thread

Message-ID: <1140642986.5777.39.camel@state.g2switchworks.com>
Permalink:  ../1140642986.5777.39.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1140642986.5777.39.camel@state.g2switchworks.com

 · 

reply

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: smarlowe@g2switchworks.com, ajs@crankycanuck.ca
  Subject: Re: Update in all tables
  In-Reply-To: <1140642986.5777.39.camel@state.g2switchworks.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