abuse of inheritance?
От | Alex Rice |
---|---|
Тема | abuse of inheritance? |
Дата | |
Msg-id | D794185A-9413-11D6-AECB-0030653DEAA0@arc.to обсуждение исходный текст |
Ответы |
Re: abuse of inheritance?
Re: abuse of inheritance? |
Список | 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 по дате отправления: