| От | Tom Lane |
|---|---|
| Тема | Re: Quick Inheritance questions |
| Дата | |
| Msg-id | 14183.1038496911@sss.pgh.pa.us обсуждение |
| Ответ на | Quick Inheritance questions (Adam Witney <awitney@sghms.ac.uk>) |
| Список | pgsql-general |
Adam Witney <awitney@sghms.ac.uk> writes:
> I have a table that inherits an id field from a parent table, is there a way
> of determining which child table the row containing a particular id value
> comes from?
SELECT tableoid, ...other stuff... FROM parenttable WHERE ...
Typically you'd add a join to pg_class so that you can identify the
table by name instead of OID, but that's the basic idea.
> Also, just out of interest, if one table inherits a field from another table
> does the values contained within that field get stored on disk twice? (once
> for the parent table and once for the child table).
No.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера