The following bug has been logged online:
Bug reference: 2954
Logged by: Sergiy Vyshnevetskiy
Email address: serg@vostok.net
PostgreSQL version: 8.2.1
Operating system: FreeBSD-6 stable
Description: null is not checked against domain constraints in return
clause
Details:
#psql = serg@[local]:5432 test
create domain "DInt" as int not null;
CREATE DOMAIN
#psql = serg@[local]:5432 test
create or replace function test() returns "DInt" immutable strict language
plpgsql as $F$begin return null; end$F$;
CREATE FUNCTION
#psql = serg@[local]:5432 test
select test() is null;
?column?
----------
t
(1 запиÑÑ)
#psql = serg@[local]:5432 test
We should have gotten an error during execution of test().