pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Angus Berry <angus.berry@elken.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: query on multiple tables in schema
Date: Fri, 1 Oct 2004 13:30:59 -0500
Message-ID: <20041001183059.GB20624@wolff.to> (raw)
In-Reply-To: <1096406359.2215.135.camel@vaio1linux>
References: <1096406359.2215.135.camel@vaio1linux>

On Tue, Sep 28, 2004 at 17:19:20 -0400,
  Angus Berry <angus.berry@elken.com> 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.



view thread (2+ messages)

Message-ID: <20041001183059.GB20624@wolff.to>
Permalink:  ../20041001183059.GB20624@wolff.to/
Also on:    postgresql.org/message-id/20041001183059.GB20624@wolff.to

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: bruno@wolff.to, angus.berry@elken.com
  Subject: Re: query on multiple tables in schema
  In-Reply-To: <20041001183059.GB20624@wolff.to>
  References: <1096406359.2215.135.camel@vaio1linux> <20041001183059.GB20624@wolff.to>

* 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