X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3464332A026 for ; Tue, 28 Sep 2004 22:19:41 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83804-03 for ; Tue, 28 Sep 2004 21:19:31 +0000 (GMT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by svr1.postgresql.org (Postfix) with ESMTP id 30FC2329F82 for ; Tue, 28 Sep 2004 22:19:15 +0100 (BST) Received: from localhost (c-24-30-77-33.mw.client2.attbi.com[24.30.77.33]) by comcast.net (sccrmhc12) with SMTP id <2004092821190501200r0ln5e>; Tue, 28 Sep 2004 21:19:05 +0000 Subject: query on multiple tables in schema From: Angus Berry Reply-To: angus.berry@elken.com To: pgsql-admin@postgresql.org Content-Type: text/plain Message-Id: <1096406359.2215.135.camel@vaio1linux> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 28 Sep 2004 17:19:20 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/8 X-Sequence-Number: 15002 Hi, I wonder if anyone can help. I'd like to execute a SQL query that performs an action on all the (unrelated) tables that I select. The following query doesn't work, but the subselect (which works) shows what I'm trying to do. All tables have an identical column called id_num. delete from (select tablename from pg_tables where schemaname = 'public') where id_num = null I'd appreciate any advice.