Re: BUG #2954: null is not checked against domain constraints in return clause

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergiy Vyshnevetskiy <serg(at)vostok(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2954: null is not checked against domain constraints in return clause
Date: 2007-02-01 19:35:17
Message-ID: 22980.1170358517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sergiy Vyshnevetskiy <serg(at)vostok(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sergiy Vyshnevetskiy 2007-02-01 21:51:32 Re: BUG #2948: default null values for not-null domains
Previous Message Tom Lane 2007-02-01 19:28:14 Re: BUG #2948: default null values for not-null domains