Search Postgresql Archives

Re: How to create unique constraint on NULL columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <db8s6o$f36$1@xxxxxxxxxxxx>, Andrus <eetasoft@xxxxxxxxx> wrote:
% > Then redesign this as a many to many relation.  That way someone can
% > have access to one, two, three, four, or all departments.
% 
% This means adding separate row for each department into permission table.
% If new department is added, I must determine in some way users which are 
% allowed access to all
% departments and add nw rows to permission table automatically.
% 
% It seems more reasonable to use NULL department value as "do'nt know, all 
% departments allowed"

But wouldn't you want to have an entry in the department table with
NULL for the department ID? I mean, why should NULL act like NULL wrt
foreign keys, but not wrt unique constraints?


-- 

Patrick TJ McPhee
North York  Canada
ptjm@xxxxxxxxxxxx

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux