I've found it useful to explore the information_schema schema by doing:

  set search_path=information_schema;  -- Lets just look at the system tables.
  \d                                   -- Show me all the tables.
...
(40 rows)

then 
  select * from some-likely-looking-table limit 20;

In this case, I quickly found a table called "columns", so you can do:
  select table_name from information_schema.columns where 
  column_name='last_modified';

Of course you could be a wuss and actually read the documentation ;-)
  http://www.postgresql.org/docs/8.1/interactive/infoschema-columns.html

-- George Young

On Fri, 21 Apr 2006 09:29:33 -0700 (PDT)
Jeff Frost <[EMAIL PROTECTED]> 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.
> 
> -- 
> Jeff Frost, Owner     <[EMAIL PROTECTED]>
> Frost Consulting, LLC         http://www.frostconsultingllc.com/
> Phone: 650-780-7908   FAX: 650-649-1954
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
> 


-- 
"Are the gods not just?"  "Oh no, child.
What would become of us if they were?" (CSL)

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to