>>>>> "Adam" == Brightwell, Adam <adam.brightw...@crunchydatasolutions.com> 
>>>>> writes:

 Adam> At any rate, this appears to be a previously existing issue
 Adam> with WITH CHECK OPTION.  Thoughts?

It's definitely an existing issue; you can reproduce it more simply,
no need to mess with different users.

The issue as far as I can tell is that the withCheckOption exprs are
not being processed anywhere in setrefs.c, so it only works at all by
pure fluke: for most operators, the opfuncid is also filled in by
eval_const_expressions, but for whatever reason SAOPs escape this
treatment. Same goes for other similar cases:

create table colors (name text);
create view vc1 as select * from colors where name is distinct from 'grue' with 
check option;
create view vc2 as select * from colors where name in ('red','green','blue') 
with check option;
create view vc3 as select * from colors where nullif(name,'grue') is null with 
check option;

insert into vc1 values ('red'); -- fails
insert into vc2 values ('red'); -- fails
insert into vc3 values ('red'); -- fails

(Also, commands/policy.c has two instances of "const char" as a
function return type, which is a compiler warning since the "const" is
meaningless.)

-- 
Andrew (irc:RhodiumToad)


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

Reply via email to