Re: select all rows where any column is NULL - Mailing list pgsql-general

From David Johnston
Subject Re: select all rows where any column is NULL
Date
Msg-id 00c301cc4bcc$86445ae0$92cd10a0$@yahoo.com
Whole thread Raw
In response to select all rows where any column is NULL  (Nathan Boley <npboley@gmail.com>)
List pgsql-general
Copy and paste the column names from the "CREATE TABLE" statement...

You can try using information schema and building a dynamic SQL query inside
a function...

If you let people know WHAT you are trying to accomplish you may find you
get alternative suggestions that you never considered.

SQL itself is designed for a variable/unknown numbers of rows but a
fixed/known number of columns.  The only way around that is to use a "table
of column names" to identify the columns and then dynamically create a query
with those "fixed/known" columns and "EXECUTE" it within a PL/PGSQL
function.

David J.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Nathan Boley
Sent: Tuesday, July 26, 2011 3:09 PM
To: PostgreSQL general
Subject: [GENERAL] select all rows where any column is NULL

Does anyone have a concise way of doing $SUBJECT?

Best,
Nathan

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


pgsql-general by date:

Previous
From: Nathan Boley
Date:
Subject: select all rows where any column is NULL
Next
From: Radosław Smogura
Date:
Subject: Re: variant column type