I'm designing the schema to store a config from our switchboards.

As with all PBX's the key is the dialed number which is either an extension 
number or a group (hunt/ring/pickup) number.

I have two tables, one for extensions and one for groups, basically

ext_id  int4 primary key
ext_desc        text
....
....
....

and



grp_id  int4 primary key
grp_desc        text
.....
.....
.....

I now need to be able to ensure the id field is unique across both tables. 
Presumably I can do this with a function and a constraint for each table. 
Does anyone have examples of this?


Next I have other tables that refer to *destinations* which will be an ID that 
could be either an extension or a group. Examples are 'Direct Dial In' 
numbers which could point to either.  How would I do that?

-- 
Gary Stainburn
Group I.T. Manager
Ringways Garages
http://www.ringways.co.uk 


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to