postgresql/src/backend/utils
Tom Lane fdba460a26 Create an RTE field to record the query's lock mode for each relation.
Add RangeTblEntry.rellockmode, which records the appropriate lock mode for
each RTE_RELATION rangetable entry (either AccessShareLock, RowShareLock,
or RowExclusiveLock depending on the RTE's role in the query).

This patch creates the field and makes all creators of RTE nodes fill it
in reasonably, but for the moment nothing much is done with it.  The plan
is to replace assorted post-parser logic that re-determines the right
lockmode to use with simple uses of rte->rellockmode.  For now, just add
Asserts in each of those places that the rellockmode matches what they are
computing today.  (In some cases the match isn't perfect, so the Asserts
are weaker than you might expect; but this seems OK, as per discussion.)

This passes check-world for me, but it seems worth pushing in this state
to see if the buildfarm finds any problems in cases I failed to test.

catversion bump due to change of stored rules.

Amit Langote, reviewed by David Rowley and Jesper Pedersen,
and whacked around a bit more by me

Discussion: https://postgr.es/m/468c85d9-540e-66a2-1dde-fec2b741e688@lab.ntt.co.jp
2018-09-30 13:55:51 -04:00
..
adt Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
cache Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
error Implement %m in src/port/snprintf.c, and teach elog.c to rely on that. 2018-09-26 13:31:56 -04:00
fmgr Clean up in the wake of TupleDescGetSlot() removal / 10763358c3. 2018-09-27 11:38:11 -07:00
hash Allow memory contexts to have both fixed and variable ident strings. 2018-03-27 16:46:51 -04:00
init Add application_name to connection authorized msg 2018-09-28 19:04:50 -04:00
mb Avoid use of unportable hex constant in convutils.pm 2018-05-27 10:41:19 -04:00
misc Add application_name to connection authorized msg 2018-09-28 19:04:50 -04:00
mmgr Constify dsa_size_class_map and use a better type. 2018-09-25 14:58:41 +12:00
resowner Use a ResourceOwner to track buffer pins in all cases. 2018-07-18 12:15:16 -04:00
sort Split ExecStoreTuple into ExecStoreHeapTuple and ExecStoreBufferHeapTuple. 2018-09-25 16:27:48 -07:00
time Fix misc typos, mostly in comments. 2018-07-18 16:17:32 +03:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
errcodes.txt Update comment in header of errcodes.txt 2018-08-16 09:47:59 +02:00
Gen_dummy_probes.pl Clean up some perlcritic warnings 2018-05-07 15:35:32 -04:00
Gen_dummy_probes.sed Update copyright for 2018 2018-01-02 23:30:12 -05:00
Gen_fmgrtab.pl Assorted minor cleanups for bootstrap-data Perl scripts. 2018-05-19 16:04:47 -04:00
generate-errcodes.pl Update copyright for 2018 2018-01-02 23:30:12 -05:00
Makefile Suppress compiler warnings when building with --enable-dtrace. 2018-05-07 13:44:09 -04:00
probes.d Support parallel btree index builds. 2018-02-02 13:32:44 -05:00