Re: Inherited table identification possible

Поиск
Список
Период
Сортировка
От Stephen Belcher
Тема Re: Inherited table identification possible
Дата
Msg-id CADJqQNmmH+F+jOO83W9vxBLov_yw5Ry+xj4Ag2daPN7WDEWnMA@mail.gmail.com
обсуждение исходный текст
Ответ на Inherited table identification possible  (George Woodring <george.woodring@iglass.net>)
Ответы Re: Inherited table identification possible
Список pgsql-sql
Yes, the system column "tableoid" identifies the actual table in which the row is stored. If you cast this to "regclass" you'll get the name of the table that the row is stored in:

SELECT tableoid::regclass FROM base_table;

There's more documentation on this available at http://www.postgresql.org/docs/9.1/static/ddl-inherit.html (for version 9.1, at any rate: season to taste with your version of PG)

Hope this helps,
--Stephen


On Thu, May 24, 2012 at 2:01 PM, George Woodring <george.woodring@iglass.net> 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.

Thanks,
George



--
iGLASS Networks
www.iglass.net

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: Inherited table identification possible
Следующее
От: "Raj Mathur (राज माथुर)"
Дата:
Сообщение: Re: Flatten table using timestamp and source