aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonpath_exec.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-06-07 14:50:09 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-06-07 14:50:09 -0400
commit7ed8ce8a469b02fa58276c6035758749ae469bcf (patch)
tree17106fbd311aeda75d1c67dcd304a1c7e02566ef /src/backend/utils/adt/jsonpath_exec.c
parent2dc1deaea0354ce8427abd8c6b11f9c004a65f24 (diff)
downloadpostgresql-7ed8ce8a469b02fa58276c6035758749ae469bcf.tar.gz
postgresql-7ed8ce8a469b02fa58276c6035758749ae469bcf.zip
Reject modifying a temp table of another session with ALTER TABLE.
Normally this case isn't even reachable by non-superusers, since permissions checks prevent naming such a table. However, it is possible to make it happen by altering a parent table whose child is another session's temp table. We definitely can't support any such ALTER that requires modifying the contents of such a table, since we lack access to the other session's temporary-buffer pool. But there seems no good reason to allow it even if it'd only require changing catalog contents. One reason not to allow it is that we'd rather not expose the implementation-dependent behavior of whether a specific ALTER requires touching the table contents. Another is that there may be (in future, even if not today) optimizations that assume that a session's own temp tables won't be modified by other sessions. Hence, add a RELATION_IS_OTHER_TEMP() check to all the places where ALTER TABLE currently does CheckTableNotInUse(). (I looked through all other callers of CheckTableNotInUse(), and they seem OK already.) Per bug #18492 from Alexander Lakhin. Back-patch to all supported branches. Discussion: https://postgr.es/m/18492-c7a2634bf4968763@postgresql.org
Diffstat (limited to 'src/backend/utils/adt/jsonpath_exec.c')
0 files changed, 0 insertions, 0 deletions