Fix `make installcheck` for serializable transactions.
authorKevin Grittner
Thu, 6 Aug 2015 15:35:19 +0000 (10:35 -0500)
committerKevin Grittner
Thu, 6 Aug 2015 15:35:19 +0000 (10:35 -0500)
Commit e5550d5fec66aa74caad1f79b79826ec64898688 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.

src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql

index c88e7a9b07cf436872206b854d0a0f7a2718fb48..4e69f2e6445669e217d7a76a6de123a3171cb63b 100644 (file)
@@ -1837,7 +1837,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'
index a7eab83ba980f4ca70e6723e560750596f720e97..8c128e61f1b93fddf746c71538f80469b924b14a 100644 (file)
@@ -1270,7 +1270,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'