postgresql/src/test/isolation/specs
Michael Paquier f841ceb26d 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
2018-08-10 18:26:59 +02:00
..
aborted-keyrevoke.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
alter-table-1.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
alter-table-2.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
alter-table-3.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
alter-table-4.spec Avoid unnecessary failure in SELECT concurrent with ALTER NO INHERIT. 2018-01-12 15:46:37 -05:00
async-notify.spec Suppress scary-looking log messages from async-notify isolation test. 2016-02-29 19:29:19 -05:00
classroom-scheduling.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
create-trigger.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
deadlock-hard.spec Increase deadlock_timeout some more in the deadlock-hard isolation test. 2016-02-12 17:22:42 -05:00
deadlock-simple.spec Add some isolation tests for deadlock detection and resolution. 2016-02-11 08:38:09 -05:00
deadlock-soft-2.spec Further tweaking of deadlock isolation tests. 2016-02-11 23:21:33 -05:00
deadlock-soft.spec Add some isolation tests for deadlock detection and resolution. 2016-02-11 08:38:09 -05:00
delete-abort-savept-2.spec Improve concurrency of foreign key locking 2013-01-23 12:04:59 -03:00
delete-abort-savept.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
drop-index-concurrently-1.spec Allow drop-index-concurrently-1 test to run at any isolation level. 2013-10-08 16:55:12 -05:00
eval-plan-qual.spec Improve regression test coverage of expand_tuple(). 2018-04-14 19:02:30 -04:00
fk-contention.spec Add support for blocked commands in isolationtester 2011-07-12 17:24:17 -04:00
fk-deadlock.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
fk-deadlock2.spec Specify permutations for isolation tests with "invalid" permutations. 2016-02-11 08:33:24 -05:00
freeze-the-dead.spec Fix pruning of locked and updated tuples. 2017-12-14 18:20:47 -08:00
index-only-scan.spec Fix serializable mode with index-only scans. 2012-09-04 21:13:11 -05:00
insert-conflict-do-nothing-2.spec Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
insert-conflict-do-nothing.spec Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. 2015-05-08 05:43:10 +02:00
insert-conflict-do-update-2.spec Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
insert-conflict-do-update-3.spec Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. 2015-05-08 05:43:10 +02:00
insert-conflict-do-update.spec Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. 2015-05-08 05:43:10 +02:00
insert-conflict-toast.spec Fix deletion of speculatively inserted TOAST on conflict 2016-08-17 17:03:36 -07:00
lock-committed-keyupdate.spec Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
lock-committed-update.spec Avoid serializability errors when locking a tuple with a committed update 2016-07-15 14:17:20 -04:00
lock-update-delete.spec Make some isolationtester specs more complete 2013-10-04 15:52:58 -03:00
lock-update-traversal.spec Indexes with INCLUDE columns and their support in B-tree 2018-04-07 23:00:39 +03:00
multiple-cic.spec Revert "Fix isolation test to be less timing-dependent" 2018-01-03 18:22:41 -03:00
multiple-row-versions.spec The row-version chaining in Serializable Snapshot Isolation was still wrong. 2011-05-30 20:47:17 +03:00
multixact-no-deadlock.spec Improve concurrency of foreign key locking 2013-01-23 12:04:59 -03:00
multixact-no-forget.spec Fix improper abort during update chain locking 2013-12-05 17:47:51 -03:00
nowait-2.spec Update copyright for 2015 2015-01-06 11:43:47 -05:00
nowait-3.spec Update copyright for 2015 2015-01-06 11:43:47 -05:00
nowait-4.spec Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
nowait-5.spec Fix FOR UPDATE NOWAIT on updated tuple chains 2014-08-27 19:15:18 -04:00
nowait.spec Add regression tests for SELECT FOR UPDATE/SHARE NOWAIT. 2014-08-25 20:14:43 +03:00
partial-index.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
partition-key-update-1.spec Raise error when affecting tuple moved into different partition. 2018-04-07 13:24:27 -07:00
partition-key-update-2.spec Raise error when affecting tuple moved into different partition. 2018-04-07 13:24:27 -07:00
partition-key-update-3.spec Raise error when affecting tuple moved into different partition. 2018-04-07 13:24:27 -07:00
partition-key-update-4.spec Allow using the updated tuple while moving it to a different partition. 2018-07-12 12:51:39 +05:30
plpgsql-toast.spec Detoast plpgsql variables if they might live across a transaction boundary. 2018-05-16 14:56:52 -04:00
predicate-gin-fastupdate.spec Re-think predicate locking on GIN indexes. 2018-05-04 11:27:50 +03:00
predicate-gin-nomatch.spec Re-think predicate locking on GIN indexes. 2018-05-04 11:27:50 +03:00
predicate-gin.spec Fix whitespace 2018-05-17 23:04:41 -04:00
predicate-gist.spec Add predicate locking for GiST 2018-03-27 15:43:19 +03:00
predicate-hash.spec Fix whitespace 2018-05-17 23:04:41 -04:00
prepared-transactions.spec Add an SSI regression test that tests all interesting permutations in the 2011-08-18 17:09:58 +03:00
project-manager.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
propagate-lock-delete.spec Don't ignore tuple locks propagated by our updates 2013-12-18 13:45:51 -03:00
read-only-anomaly-2.spec Add isolation test for SERIALIZABLE READ ONLY DEFERRABLE. 2017-04-05 10:04:36 -05:00
read-only-anomaly-3.spec Add isolation test for SERIALIZABLE READ ONLY DEFERRABLE. 2017-04-05 10:04:36 -05:00
read-only-anomaly.spec Add isolation test for SERIALIZABLE READ ONLY DEFERRABLE. 2017-04-05 10:04:36 -05:00
read-write-unique-2.spec Detect SSI conflicts before reporting constraint violations 2016-04-07 11:12:35 -05:00
read-write-unique-3.spec Detect SSI conflicts before reporting constraint violations 2016-04-07 11:12:35 -05:00
read-write-unique-4.spec Detect SSI conflicts before reporting constraint violations 2016-04-07 11:12:35 -05:00
read-write-unique.spec Detect SSI conflicts before reporting constraint violations 2016-04-07 11:12:35 -05:00
receipt-report.spec Fix typos in comments. 2017-02-06 11:33:58 +02:00
referential-integrity.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
ri-trigger.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
sequence-ddl.spec Make ALTER SEQUENCE, including RESTART, fully transactional. 2017-06-01 14:19:33 -07:00
simple-write-skew.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
skip-locked-2.spec Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
skip-locked-3.spec Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
skip-locked-4.spec Update copyright for 2015 2015-01-06 11:43:47 -05:00
skip-locked.spec Implement SKIP LOCKED for row-level locks 2014-10-07 17:23:34 -03:00
temporal-range-integrity.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
timeouts.spec Bump up timeout delays some more in timeouts isolation test. 2013-03-20 13:53:43 -04:00
total-cash.spec Implement genuine serializable isolation level. 2011-02-08 00:09:08 +02:00
truncate-conflict.spec Improve TRUNCATE by avoiding early lock queue 2018-08-10 18:26:59 +02:00
tuplelock-conflict.spec Fix thinko in lock mode enum 2015-01-04 15:48:29 -03:00
tuplelock-update.spec Make new isolationtester test more stable 2016-02-29 16:34:56 -03:00
two-ids.spec Fix typos in comments. 2017-02-06 11:33:58 +02:00
update-locked-tuple.spec Avoid serializability errors when locking a tuple with a committed update 2016-07-15 14:17:20 -04:00
vacuum-concurrent-drop.spec Speed up isolation test for concurrent VACUUM/ANALYZE behavior. 2017-12-07 11:11:07 -05:00
vacuum-reltuples.spec Repair test for vacuum reltuples fix. 2017-03-17 14:35:54 +00:00