From: Jeff Frost <jeff@frostconsultingllc.com>
To: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-sql@postgresql.org
Subject: Re: find all tables with a specific column name?
Date: Fri, 21 Apr 2006 11:30:25 -0700 (PDT)
Message-ID: <Pine.LNX.4.64.0604211129340.1527@glacier.frostconsultingllc.com> (raw)
In-Reply-To: <20060421180356.GB13275@wolff.to>
References: <Pine.LNX.4.64.0604210928220.1527@glacier.frostconsultingllc.com>
<20060421180356.GB13275@wolff.to>
On Fri, 21 Apr 2006, Bruno Wolff III wrote:
> On Fri, Apr 21, 2006 at 09:29:33 -0700,
> Jeff Frost <jeff@frostconsultingllc.com> wrote:
>> Is there a reasonable way to extract a list of all tables which contain a
>> specific column name from the system views on 8.1?
>>
>> For instance, I might want to enumerate all tables with a column named
>> last_modified.
>
> Take a look at:
> http://developer.postgresql.org/docs/postgres/infoschema-columns.html
Thanks Bruno! It appears I can simply do this:
select table_name from information_schema.columns where column_name =
'last_modified';
--
Jeff Frost, Owner <jeff@frostconsultingllc.com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954
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-sql@postgresql.org
Cc: jeff@frostconsultingllc.com, bruno@wolff.to
Subject: Re: find all tables with a specific column name?
In-Reply-To: <Pine.LNX.4.64.0604211129340.1527@glacier.frostconsultingllc.com>
References: <Pine.LNX.4.64.0604210928220.1527@glacier.frostconsultingllc.com> <20060421180356.GB13275@wolff.to> <Pine.LNX.4.64.0604211129340.1527@glacier.frostconsultingllc.com>
* 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