X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id E6F719DC868 for ; Wed, 22 Feb 2006 17:13:49 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 79861-08 for ; Wed, 22 Feb 2006 17:13:51 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from r1.mycybernet.net (r1.mycybernet.net [209.5.206.8]) by postgresql.org (Postfix) with ESMTP id C59549DC84B for ; Wed, 22 Feb 2006 17:13:47 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227]:34938 helo=phlogiston.dydns.org) by r1.mycybernet.net with esmtp (Exim 4.50 (FreeBSD)) id 1FC1Iy-0001in-WD for pgsql-sql@postgresql.org; Wed, 22 Feb 2006 16:13:49 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 2245A3FAF; Wed, 22 Feb 2006 16:13:48 -0500 (EST) Date: Wed, 22 Feb 2006 16:13:48 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Update in all tables Message-ID: <20060222211348.GE8741@phlogiston.dyndns.org> References: <1140631146.5580.5.camel@Desarrollo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1140631146.5580.5.camel@Desarrollo> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.087 required=5 tests=[AWL=0.087] X-Spam-Score: 0.087 X-Spam-Level: X-Archive-Number: 200602/273 X-Sequence-Number: 24283 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). A -- Andrew Sullivan | ajs@crankycanuck.ca Unfortunately reformatting the Internet is a little more painful than reformatting your hard drive when it gets out of whack. --Scott Morris