]> granicus.if.org Git - postgresql/commit
Fix bogus provolatile/proparallel markings on a few built-in functions.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Mar 2018 22:14:51 +0000 (18:14 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 Mar 2018 22:14:51 +0000 (18:14 -0400)
commitb7537ffb1ab59b3fedf6d01e6074fa2d465756c3
tree00f574f66a00c02feef1bb1c49f052186aa4af30
parent839e26e31b6bc10a3b49b4b860d6bc21e81d46de
Fix bogus provolatile/proparallel markings on a few built-in functions.

Richard Yen reported that pg_upgrade failed if the target cluster had
force_parallel_mode = on, because binary_upgrade_create_empty_extension()
is marked parallel restricted, allowing it to be executed in parallel
mode, which complains because it tries to acquire an XID.

In general, no function that might try to modify database data should
be considered parallel safe or restricted, since execution of it might
force XID acquisition.  We found several other examples of this mistake.

Furthermore, functions that execute user-supplied SQL queries or query
fragments, or pull data from user-supplied cursors, had better be marked
both volatile and parallel unsafe, because we don't know what the supplied
query or cursor might try to do.  There were several tsquery and XML
functions that had the wrong proparallel marking for this, and some of
them were even mislabeled as to volatility.

All these bugs are old, dating back to 9.6 for the proparallel mistakes
and much further for the provolatile mistakes.  We can't force a
catversion bump in the back branches, but we can at least ensure that
installations initdb'd in future have the right values.

Thomas Munro and Tom Lane

Discussion: https://postgr.es/m/CAEepm=2sNDScSLTfyMYu32Q=ob98ZGW-vM_2oLxinzSABGQ6VA@mail.gmail.com
src/include/catalog/pg_proc.h