]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Disallow calling anything but plain functions via the fastpath API.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Apr 2021 18:10:26 +0000 (14:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Apr 2021 18:10:26 +0000 (14:10 -0400)
commit0627f3630ce780e39aee0dc5881076a6148fcc18
treeb95903cc383abd0550fabec896ab40a9573e138d
parentd5722c92795d6300be731bd7af4b41567e402c79
Disallow calling anything but plain functions via the fastpath API.

Reject aggregates, window functions, and procedures.  Aggregates
failed anyway, though with a somewhat obscure error message.
Window functions would hit an Assert or null-pointer dereference.
Procedures seemed to work as long as you didn't try to do
transaction control, but (a) transaction control is sort of the
point of a procedure, and (b) it's not entirely clear that no
bugs lurk in that path.  Given the lack of testing of this area,
it seems safest to be conservative in what we support.

Also reject proretset functions, as the fastpath protocol can't
support returning a set.

Also remove an easily-triggered assertion that the given OID
isn't 0; the subsequent lookups can handle that case themselves.

Per report from Theodor-Arsenij Larionov-Trichkin.
Back-patch to all supported branches.  (The procedure angle
only applies in v11+, of course.)

Discussion: https://postgr.es/m/2039442.1615317309@sss.pgh.pa.us
src/backend/tcop/fastpath.c