Re: getting inherited table name

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: getting inherited table name
Дата
Msg-id Pine.LNX.4.30.0109061507340.823-100000@peter.localdomain
обсуждение исходный текст
Ответ на getting inherited table name  (Eric Kolve <ekolve@corp.classmates.com>)
Список pgsql-general
Eric Kolve writes:

> When you do SELECT * FROM cities, you get both capitals and cities.  Is
> there anyway to get get the name of the table so I could possibly know
> the 'type' it was? Or should this be maintained as a separate column
> 'city_type' that has a value of 'capital'?

There's an otherwise hidden column called "tableoid" that contains the oid
of the table the row really came from.  You can join that against pg_class
to get the name of the table.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


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

Предыдущее
От: Andrew Gould
Дата:
Сообщение: Re: template0 and template1 databases
Следующее
От: David Wheeler
Дата:
Сообщение: Re: Bug in createlang?