aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/parallel.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2018-08-10 18:26:59 +0200
committerMichael Paquier <michael@paquier.xyz>2018-08-10 18:26:59 +0200
commitf841ceb26d701e7f5f48190bf7290c400cba30a2 (patch)
tree6744ff440333ec7dd2ac1329511323c677525c6d /src/backend/access/transam/parallel.c
parent2b13702d5c7e879bdd0587a80d5cfaeb5206f4ea (diff)
downloadpostgresql-f841ceb26d701e7f5f48190bf7290c400cba30a2.tar.gz
postgresql-f841ceb26d701e7f5f48190bf7290c400cba30a2.zip
Improve TRUNCATE by avoiding early lock queue
A caller of TRUNCATE could previously queue for an access exclusive lock on a relation it may not have permission to truncate, potentially interfering with users authorized to work on it. This can be very intrusive depending on the lock attempted to be taken. For example, pg_authid could be blocked, preventing any authentication attempt to happen on a PostgreSQL instance. This commit fixes the case of TRUNCATE so as RangeVarGetRelidExtended is used with a callback doing the necessary ACL checks at an earlier stage, avoiding lock queuing issues, so as an immediate failure happens for unprivileged users instead of waiting on a lock that would not be taken. This is rather similar to the type of work done in cbe24a6 for CLUSTER, and the code of TRUNCATE is this time refactored so as there is no user-facing changes. As the commit for CLUSTER, no back-patch is done. Reported-by: Lloyd Albin, Jeremy Schneider Author: Michael Paquier Reviewed by: Nathan Bossart, Kyotaro Horiguchi Discussion: https://postgr.es/m/152512087100.19803.12733865831237526317@wrigleys.postgresql.org Discussion: https://postgr.es/m/20180806165816.GA19883@paquier.xyz
Diffstat (limited to 'src/backend/access/transam/parallel.c')
0 files changed, 0 insertions, 0 deletions