abuse of inheritance? - Mailing list pgsql-general

From Alex Rice
Subject abuse of inheritance?
Date
Msg-id D794185A-9413-11D6-AECB-0030653DEAA0@arc.to
Whole thread Raw
Responses Re: abuse of inheritance?  (Oliver Elphick <olly@lfix.co.uk>)
Re: abuse of inheritance?  (Curt Sampson <cjs@cynic.net>)
List 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@arc.to
alrice@swcp.com



pgsql-general by date:

Previous
From: Andreas Schlegel
Date:
Subject: Re: Flag for insentive use of Postgres?
Next
From: Stephane Bortzmeyer
Date:
Subject: Re: Flag for insentive use of Postgres?