postgresql/src/pl
Tom Lane 51db0d18fb Fix plpgsql to enforce domain checks when returning a NULL domain value.
If a plpgsql function is declared to return a domain type, and the domain's
constraints forbid a null value, it was nonetheless possible to return
NULL, because we didn't bother to check the constraints for a null result.
I'd noticed this while fooling with domains-over-composite, but had not
gotten around to fixing it immediately.

Add a regression test script exercising this and various other domain
cases, largely borrowed from the plpython_types test.

Although this is clearly a bug fix, I'm not sure whether anyone would
thank us for changing the behavior in stable branches, so I'm inclined
not to back-patch.
2018-02-15 16:25:19 -05:00
..
plperl Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
plpgsql Fix plpgsql to enforce domain checks when returning a NULL domain value. 2018-02-15 16:25:19 -05:00
plpython Fix broken logic for reporting PL/Python function names in errcontext. 2018-02-14 14:47:18 -05:00
tcl Transaction control in PL procedures 2018-01-22 08:43:06 -05:00
Makefile Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00