From: | Alex Rice <alex_rice(at)arc(dot)to> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | abuse of inheritance? |
Date: | 2002-07-10 14:46:39 |
Message-ID: | D794185A-9413-11D6-AECB-0030653DEAA0@arc.to |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Should I be using table inheritance in this scenario?
Table "contact" has name, address, phone, email, etc. columns.
Table "staff" inherits from "contact because it has many columns in
common with "contact".
But I want to query staff and get a list of staff-- and omit non-staff
contacts. The ONLY directive only works down the inheritance tree, so I
would have to do (something like) this to get a list of staff only:
SELECT staff.whatever
FROM staff, pg_class
WHERE staff.tableoid = pg_class.oid AND pg_class.relname = 'staff'
This strikes me as kinda funny and maybe I should not have inherited
staff from contact to begin with? Not really up to speed on the whole
object-relational concept yet. :-)
Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice(at)arc(dot)to
alrice(at)swcp(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Schlegel | 2002-07-10 14:46:53 | Re: Flag for insentive use of Postgres? |
Previous Message | Neil Conway | 2002-07-10 14:40:31 | Re: Flag for insentive use of Postgres? |