1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Fix make installcheck for serializable transactions.

Commit e5550d5fec added some new
tests for ALTER TABLE which involved table scans.  When
default_transaction_isolation = 'serializable' these acquire
relation-level SIReadLocks.  The test results didn't cope with
that.  Add SIReadLock as the minimum lock level for purposes of
these tests.

This could also be fixed by excluding this type of lock from the
my_locks view, but it would be a bug for SIReadLock to show up for
a relation which was not otherwise locked, so do it this way to
allow that sort of condition to cause a regression test failure.

There is some question whether we could avoid taking SIReadLocks
during these operations, but confirming the safety of that and
figuring out how to avoid the locks is not trivial, and would be
a separate patch.

Backpatch to 9.4 where the new tests were added.
This commit is contained in:
Kevin Grittner
2015-08-06 10:35:14 -05:00
parent 449b13313c
commit 680b82eea8
2 changed files with 4 additions and 2 deletions

View File

@ -1842,7 +1842,8 @@ DROP TABLE check_fk_presence_1, check_fk_presence_2;
drop type lockmodes;
ERROR: type "lockmodes" does not exist
create type lockmodes as enum (
'AccessShareLock'
'SIReadLock'
,'AccessShareLock'
,'RowShareLock'
,'RowExclusiveLock'
,'ShareUpdateExclusiveLock'

View File

@ -1271,7 +1271,8 @@ DROP TABLE check_fk_presence_1, check_fk_presence_2;
--
drop type lockmodes;
create type lockmodes as enum (
'AccessShareLock'
'SIReadLock'
,'AccessShareLock'
,'RowShareLock'
,'RowExclusiveLock'
,'ShareUpdateExclusiveLock'