Search Postgresql Archives

Non inheritable check constraint

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

 



I have gone through the issue of making a parent table not writable. After discussing it (1) I adopted the trigger solution. But I think that a trigger is just an invisible layer over the database model and so I'm naively proposing a new syntax to postgresql. It would inform that the check constraint is not inheritable:

create table t (c integer check NOT INHERITABLE (false));

I found a model visible solution but it only prevents non null values from being inserted. Or only prevents all inserts if that column is not null:

create table tfk (c integer unique check(false));
create table t (c integer, foreign key (c) references tfk(c));

Regards, Clodoaldo

(1) http://stackoverflow.com/questions/9545783/how-to-prevent-inserts-in-a-table

[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