aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-02-18 11:37:27 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2022-02-18 11:37:27 -0500
commitce1e7a2f716919652c280937087b24937677f8b3 (patch)
tree7d920b426ca4217cb92e9ff3c076dc8cc085b294 /src/backend/access/gist
parentde447bb8e6fbbad19f964a2d7f04c9ccc1d06903 (diff)
downloadpostgresql-ce1e7a2f716919652c280937087b24937677f8b3.tar.gz
postgresql-ce1e7a2f716919652c280937087b24937677f8b3.zip
Don't let libpq "event" procs break the state of PGresult objects.
As currently implemented, failure of a PGEVT_RESULTCREATE callback causes the PGresult to be converted to an error result. This is intellectually inconsistent (shouldn't a failing callback likewise prevent creation of the error result? what about side-effects on the behavior seen by other event procs? why does PQfireResultCreateEvents act differently from PQgetResult?), but more importantly it destroys any promises we might wish to make about the behavior of libpq in nontrivial operating modes, such as pipeline mode. For example, it's not possible to promise that PGRES_PIPELINE_SYNC results will be returned if an event callback fails on those. With this definition, expecting applications to behave sanely in the face of possibly-failing callbacks seems like a very big lift. Hence, redefine the result of a callback failure as being simply that that event procedure won't be called any more for this PGresult (which was true already). Event procedures can still signal failure back to the application through out-of-band mechanisms, for example via their passthrough arguments. Similarly, don't let failure of a PGEVT_RESULTCOPY callback prevent PQcopyResult from succeeding. That definition allowed a misbehaving event proc to break single-row mode (our sole internal use of PQcopyResult), and it probably had equally deleterious effects for outside uses. Discussion: https://postgr.es/m/3185105.1644960083@sss.pgh.pa.us
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions