Re: [SQL] foreign key question

2011-01-05 Thread Jasen Betts
On 2011-01-05, Gary Stainburn wrote: > On Wednesday 05 January 2011 09:53:43 Gary Stainburn wrote: >> Now I want to set up a new access level table specific to the itinerary, >> along the lines of >> >> u_id int4 not null references users(u_id) >> fl_level int4 not null references facility_levels(

Re: [SQL] foreign key question

2011-01-05 Thread Gary Stainburn
On Wednesday 05 January 2011 09:53:43 Gary Stainburn wrote: > Now I want to set up a new access level table specific to the itinerary, > along the lines of > > u_id int4 not null references users(u_id) > fl_level int4 not null references facility_levels(16, fl_level) > > Firstly, is this possible,

[SQL] foreign key question

2011-01-05 Thread Gary Stainburn
Hi folks, I have a table which lists facilities and another table that lists access levels for those facilities. All straight forward using a foreign key set up using a normal references clause. users=# select f_id, f_desc from facilities order by f_id; f_id | f_desc