postgresql/src
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
..
backend Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
bin Correct overflow handling in pgbench. 2018-09-27 21:50:57 -07:00
common Add application_name to connection authorized msg 2018-09-28 19:04:50 -04:00
fe_utils Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:42:40 +01:00
include Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
interfaces Tweak MSVC build system to match changes in 7143b3e82. 2018-09-28 15:17:07 -04:00
makefiles Refactor installation of extension headers. 2018-09-07 14:19:14 +01:00
pl Clean up *printf macros to avoid conflict with format archetypes. 2018-09-26 17:35:01 -04:00
port Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -04:00
template Make some fixes to allow building Postgres on macOS 10.14 ("Mojave"). 2018-09-25 13:23:29 -04:00
test Create an RTE field to record the query's lock mode for each relation. 2018-09-30 13:55:51 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:22 -04:00
tools Tweak MSVC build system to match changes in 7143b3e82. 2018-09-28 15:49:05 -04:00
tutorial Deduplicate "invalid input syntax" messages for various types. 2018-07-22 14:58:01 -07:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -04:00
Makefile.shlib Use -Bsymbolic for shared libraries on HP-UX and Solaris. 2018-09-10 22:22:12 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00