Re: Quick Inheritance questions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Witney <awitney(at)sghms(dot)ac(dot)uk>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Quick Inheritance questions
Date: 2002-11-28 15:21:51
Message-ID: 14183.1038496911@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adam Witney <awitney(at)sghms(dot)ac(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message jerome 2002-11-28 15:27:03 Incremental backup?
Previous Message Tom Lane 2002-11-28 15:20:02 Re: tuplestore : write failed