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 1B70732A228 for ; Fri, 1 Oct 2004 19:21:02 +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 27636-08 for ; Fri, 1 Oct 2004 18:21:00 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 3C0CB32A1D7 for ; Fri, 1 Oct 2004 19:21:00 +0100 (BST) Received: (qmail 21430 invoked by uid 500); 1 Oct 2004 18:30:59 -0000 Date: Fri, 1 Oct 2004 13:30:59 -0500 From: Bruno Wolff III To: Angus Berry Cc: pgsql-admin@postgresql.org Subject: Re: query on multiple tables in schema Message-ID: <20041001183059.GB20624@wolff.to> Mail-Followup-To: Angus Berry , pgsql-admin@postgresql.org References: <1096406359.2215.135.camel@vaio1linux> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1096406359.2215.135.camel@vaio1linux> User-Agent: Mutt/1.5.6i 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/22 X-Sequence-Number: 15016 On Tue, Sep 28, 2004 at 17:19:20 -0400, Angus Berry wrote: > 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 id_num = null will always return NULL which is not TRUE so that no rows will be selected for deletion. Try using IS NULL instead.