aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-01-16 15:23:11 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-01-16 15:23:11 -0500
commitd43a619c60405ecda275ca9e3ac9ead242e20ecb (patch)
treeabef4f102faddf78034b0304367403b600914e4c /src/test
parent4e46c97fde42fa8ca57d29b9b47f2ebd11ab8105 (diff)
downloadpostgresql-d43a619c60405ecda275ca9e3ac9ead242e20ecb.tar.gz
postgresql-d43a619c60405ecda275ca9e3ac9ead242e20ecb.zip
Fix check_srf_call_placement() to handle VALUES cases correctly.
INSERT ... VALUES with a single VALUES row is implemented quite differently from the general VALUES case. A user-visible implication of that is that we accept SRFs in the single-row case, but not in the multi-row case. That's a historical artifact no doubt, but in view of the lack of field complaints, I'm not excited about fixing it right now. However, check_srf_call_placement() needs to know about this, first because it should throw an error in the unsupported case, and second because it should set p_hasTargetSRFs in the single-row case (because we treat that like a SELECT tlist). That's an oversight in commit a4c35ea1c. To fix, split EXPR_KIND_VALUES into two values. So far as I can see, this is the only place where we need to distinguish the two cases at present; but there might be more later. Patch by me, per report from Andres Freund. Discussion: https://postgr.es/m/20170116081548.zg63zltblwimpfgp@alap3.anarazel.de
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/tsrf.out4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/regress/expected/tsrf.out b/src/test/regress/expected/tsrf.out
index 8c54f717df8..7bb6d17fcb0 100644
--- a/src/test/regress/expected/tsrf.out
+++ b/src/test/regress/expected/tsrf.out
@@ -374,7 +374,9 @@ LINE 1: INSERT INTO fewmore VALUES(1) RETURNING generate_series(1,3)...
^
-- nor standalone VALUES (but surely this is a bug?)
VALUES(1, generate_series(1,2));
-ERROR: set-valued function called in context that cannot accept a set
+ERROR: set-returning functions are not allowed in VALUES
+LINE 1: VALUES(1, generate_series(1,2));
+ ^
-- We allow tSRFs that are not at top level
SELECT int4mul(generate_series(1,2), 10);
int4mul