find columns that contain a single value for all rows

From: gkl12799(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: find columns that contain a single value for all rows
Date: 2007-01-16 19:24:18
Message-ID: F95EB440-A48B-4044-AC6A-5EF1A4944C9B@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is there an easy way to find all the columns in all the tables in a
database which contain the same value for all rows?

For example, Column A contains the value '365' for all of the rows in
Table One:

Col A
--------
365
365
365
365
365
...
...
...

I need a recursive function or query that will find all columns like
this and remove them from their respective tables ...

Thanks,

Gerry

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-01-16 19:42:09 Re: Improve Postgres Query Speed
Previous Message Richard Huxton 2007-01-16 19:19:44 Re: trigger howto question