Determining Inheritance

From: "Gordon Ross" <G(dot)Ross(at)ccw(dot)gov(dot)uk>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Determining Inheritance
Date: 2003-10-01 09:51:59
Message-ID: sf7aa3c9.006@groupwise.ccw.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there any way to determine which table a row belows to, if I do a
search on the top level table:

e.g. I have a table called "BASE". There are two tables which inherit
from "BASE" called "SUBTABLE1" and "SUBTABLE2"

If I do a SELECT * FROM BASE WHERE blah; how can I tell which table
(either SUBTABLE1 or SUBTABLE2) a row comes from ?

Do I need to add an extra column to BASE to specify which table a row
really belongs to ?

(If it helps or hinders, I am ultimately going to be doing this via
JDBC)

Thanks,

GTG

Gordon Ross,
Network Manager/Rheolwr Rhydwaith
Countryside Council for Wales/Cyngor Cefn Gwlad Cymru

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message CN 2003-10-01 11:47:46 Creating Index
Previous Message Mark Roberts 2003-10-01 09:44:15 Unsubscribe