Re: Querying a parent table's child schemas

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matthews, James" <jmatthews(at)Railpower(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Querying a parent table's child schemas
Date: 2007-08-30 19:57:07
Message-ID: 21705.1188503827@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Matthews, James" <jmatthews(at)Railpower(dot)com> writes:
> I do the following:

> SELECT a.date, a.log_msg, p.relname
> FROM alarms a, pg_class p
> WHERE a.tableoid = p.oid;

> The relname column just lists alarms for every row.

If they're all named 'alarms', then yeah ... what you need is another
join to pg_namespace using relnamespace.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mija Lee 2007-08-30 20:32:07 Re: Could not remove file messages
Previous Message Matthews, James 2007-08-30 19:33:06 Re: Querying a parent table's child schemas