Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group