[GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain text check (length(value) 2); create table my_table (name my_domain); create function f(text) returns void as $$ declare

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
As you can see, I have data in my_table that violates the check constraint. # select * from my_table; name ── test (1 row) # \d+ my_table Table public.my_table Column │ Type│ Modifiers │ Storage │ Stats target │ Description

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Adrian Klaver
On 07/09/2013 04:05 PM, Joe Van Dyk wrote: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain text check (length(value) 2); create table my_table (name my_domain); create

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Joe Van Dyk
On Tue, Jul 9, 2013 at 4:29 PM, Adrian Klaver adrian.kla...@gmail.comwrote: On 07/09/2013 04:05 PM, Joe Van Dyk wrote: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? Session 1: create domain my_domain

Re: [GENERAL] plpgsql plan caching allowing invalid data to enter table?

2013-07-09 Thread Tom Lane
Joe Van Dyk j...@tanga.com writes: It's looking like I can use a plpgsql function to insert data into a table that violates a domain constraint. Is this a known problem? I think it's not really plpgsql's fault but domain_in's --- there's no provision for flushing the latter's cached info about