Re: Inherited table identification possible

From: "Jonathan S(dot) Katz" <jonathan(dot)katz(at)excoventures(dot)com>
To: George Woodring <george(dot)woodring(at)iglass(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Inherited table identification possible
Date: 2012-05-24 18:09:59
Message-ID: D5CD4072-638C-4270-864D-801F63144585@excoventures.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On May 24, 2012, at 2:01 PM, George Woodring wrote:

> Is it possible to identify which inherited table data came from in a query? We have a table that has 3 inherited tables attached to it. I am looking for a way to identify the source of the data.
>
> My only thought would be to add a column to the tables that identify the table. I was just checking if there was a way to do it without the column.

There is a special column on every row of your table called "tableoid" which identifies the original relation the row belongs to. This identifier can be matched up to the name of the relation in the pg_class table.

There is some more info on this page: http://www.postgresql.org/docs/current/static/ddl-system-columns.html

Jonathan

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephen Belcher 2012-05-24 18:11:04 Re: Inherited table identification possible
Previous Message George Woodring 2012-05-24 18:01:28 Inherited table identification possible