BUG #2954: null is not checked against domain constraints in return clause - Mailing list pgsql-bugs

From Sergiy Vyshnevetskiy
Subject BUG #2954: null is not checked against domain constraints in return clause
Date
Msg-id 200702011543.l11FhtSB071525@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #2954: null is not checked against domain constraints in return clause
List pgsql-bugs
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().

pgsql-bugs by date:

Previous
From: Sergiy Vyshnevetskiy
Date:
Subject: Re: BUG #2948: default null values for not-null domains
Next
From: Sergiy Vyshnevetskiy
Date:
Subject: Re: BUG #2954: null is not checked against domain constraints in return clause