aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-11-20 14:26:19 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-11-20 14:26:19 -0500
commit71db302ecf4876f898ef49a57f9cb92b828ad736 (patch)
tree9035fa18ab7d7919194bdcea7cd46c69de52c558 /src/tutorial
parent46b6f3fff0f11b22538d63f3711b206250bc6962 (diff)
downloadpostgresql-71db302ecf4876f898ef49a57f9cb92b828ad736.tar.gz
postgresql-71db302ecf4876f898ef49a57f9cb92b828ad736.zip
Prevent multicolumn expansion of "foo.*" in an UPDATE source expression.
Because we use transformTargetList() for UPDATE as well as SELECT tlists, the code accidentally tried to expand a "*" reference into several columns. This is nonsensical, because the UPDATE syntax provides exactly one target column to put the value into. The immediate result was that transformUpdateTargetList() got confused and reported "UPDATE target count mismatch --- internal error". It seems better to treat such a reference as a plain whole-row variable, as it would be in other contexts. (This could produce useful results when the target column is of composite type.) Fix by tweaking transformTargetList() to perform *-expansion only conditionally, depending on its exprKind parameter. Back-patch to 9.3. The problem exists further back, but a fix would be much more invasive before that, because transformTargetList() wasn't told what kind of list it was working on. Doesn't seem worth the trouble given the lack of field reports. (I only noticed it because I was checking the code while trying to improve the documentation about how we handle "foo.*".) Discussion: <4308.1479595330@sss.pgh.pa.us>
Diffstat (limited to 'src/tutorial')
0 files changed, 0 insertions, 0 deletions