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

From Tom Lane
Subject Re: BUG #2954: null is not checked against domain constraints in return clause
Date
Msg-id 22980.1170358517@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #2954: null is not checked against domain constraints in return clause  (Sergiy Vyshnevetskiy <serg@vostok.net>)
List pgsql-bugs
Sergiy Vyshnevetskiy <serg@vostok.net> writes:
> I believe the bug to be here:
>        /* Normal case for scalar results */
>        estate->retval = exec_eval_expr(estate, stmt->expr,
>                        &(estate->retisnull),
>                        &(estate->rettype));

> in exec_stmt_return() in pl_exec.c.

No, I don't think that code is wrong, the problem is that it's never
reached.  See the
        else if (!estate.retisnull)
line a bit further up.  Probably you can fix it with a small change to
check type strictness there.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2948: default null values for not-null domains
Next
From: Sergiy Vyshnevetskiy
Date:
Subject: Re: BUG #2948: default null values for not-null domains