diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-01-08 20:18:13 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-01-08 20:18:13 -0500 |
commit | 97a39f295fd38a6083dfac96a0f1745f60ed5f9a (patch) | |
tree | 26870c26a92e5c37fcd5f3697048b2e4eb7b27e3 /src/backend/commands/constraint.c | |
parent | 3bd8987ef88b8cf2c4c792ef5bbc46fc852e0f13 (diff) | |
download | postgresql-97a39f295fd38a6083dfac96a0f1745f60ed5f9a.tar.gz postgresql-97a39f295fd38a6083dfac96a0f1745f60ed5f9a.zip |
Fix "cannot accept a set" error when only some arms of a CASE return a set.
In commit c1352052ef1d4eeb2eb1d822a207ddc2d106cb13, I implemented an
optimization that assumed that a function's argument expressions would
either always return a set (ie multiple rows), or always not. This is
wrong however: we allow CASE expressions in which some arms return a set
of some type and others just return a scalar of that type. There may be
other examples as well. To fix, replace the run-time test of whether an
argument returned a set with a static precheck (expression_returns_set).
This adds a little bit of query startup overhead, but it seems barely
measurable.
Per bug #8228 from David Johnston. This has been broken since 8.0,
so patch all supported branches.
Diffstat (limited to 'src/backend/commands/constraint.c')
0 files changed, 0 insertions, 0 deletions