pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ben K. <bkim@coe.tamu.edu>
To: Jeff Frost <jeff@frostconsultingllc.com>
Cc: Bruno Wolff III <bruno@wolff.to>
Cc: pgsql-sql@postgresql.org
Subject: Re: find all tables with a specific column name?
Date: Sat, 22 Apr 2006 16:37:07 -0500 (CDT)
Message-ID: <Pine.GSO.4.64.0604221559200.21736@coe.tamu.edu> (raw)
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>

>>> 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.

This is nothing new but if I may, may I add for this thread's completeness 
a try from internal tables?

select a.relkind, a.relname from pg_class a inner join pg_attribute b on 
a.relfilenode = b.attrelid group by a.relkind, a.relname, 
a.relfilenode,b.attname having b.attname='IID';

The result didn't match the one from the information_schema.tables - the 
above query included indexes too (relkind=i) while 
information_schema.tables included only tables and views (r,v).


Ben K.
Developer
http://benix.tamu.edu



view thread (5+ messages)

Message-ID: <Pine.GSO.4.64.0604221559200.21736@coe.tamu.edu>
Permalink:  ../Pine.GSO.4.64.0604221559200.21736@coe.tamu.edu/
Also on:    postgresql.org/message-id/Pine.GSO.4.64.0604221559200.21736@coe.tamu.edu

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bkim@coe.tamu.edu, jeff@frostconsultingllc.com, bruno@wolff.to
  Subject: Re: find all tables with a specific column name?
  In-Reply-To: <Pine.GSO.4.64.0604221559200.21736@coe.tamu.edu>

* 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