]> 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)
commitebc2ff076ef24d58cd488dbd010ebeb052378625
tree7e48fc4b6fc8da609779887a988193ad56d466b5
parent404946d40109fb247f51b553ac00198765c6c1cb
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