pgsql: Disallow calling anything but plain functions via the fastpath A - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Disallow calling anything but plain functions via the fastpath A
Date
Msg-id E1lcXbF-0008Bt-MG@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4d225ba0e6da73ddcbf207d2d91fc26537cfc5e1

Modified Files
--------------
src/backend/tcop/fastpath.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Fix the bugs in selecting the transaction for streaming.
Next
From: Tom Lane
Date:
Subject: pgsql: Doc: update libpq's documentation for PQfn().