diff --git a/contrib/pgrowlocks/Makefile b/contrib/pgrowlocks/Makefile
index 294c05dd0f..128f345b7e 100644
--- a/contrib/pgrowlocks/Makefile
+++ b/contrib/pgrowlocks/Makefile
@@ -9,6 +9,9 @@ EXTENSION = pgrowlocks
 DATA = pgrowlocks--1.2.sql pgrowlocks--1.1--1.2.sql pgrowlocks--1.0--1.1.sql
 PGFILEDESC = "pgrowlocks - display row locking information"
 
+REGRESS = pgrowlocks
+ISOLATION = show_rowlocks_info
+
 ifdef USE_PGXS
 PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
diff --git a/contrib/pgrowlocks/expected/pgrowlocks.out b/contrib/pgrowlocks/expected/pgrowlocks.out
new file mode 100644
index 0000000000..9daf600e50
--- /dev/null
+++ b/contrib/pgrowlocks/expected/pgrowlocks.out
@@ -0,0 +1,28 @@
+--
+-- Test pgrowlocks extension
+--
+CREATE EXTENSION pgrowlocks;
+-- set up
+CREATE TABLE test(c int);
+-- check permission to use pgrowlocks extension;
+CREATE ROLE regress_priv_user1 superuser login;
+CREATE ROLE regress_priv_user2;
+CREATE ROLE regress_priv_user3;
+SET SESSION AUTHORIZATION regress_priv_user1;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+ locked_row | locker | multi | xids | modes 
+------------+--------+-------+------+-------
+(0 rows)
+
+SET SESSION AUTHORIZATION regress_priv_user2;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- fail
+ERROR:  permission denied for table test
+-- switch to superuser
+\c -
+GRANT SELECT ON test TO regress_priv_user3;
+SET SESSION AUTHORIZATION regress_priv_user3;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+ locked_row | locker | multi | xids | modes 
+------------+--------+-------+------+-------
+(0 rows)
+
diff --git a/contrib/pgrowlocks/expected/show_rowlocks_info.out b/contrib/pgrowlocks/expected/show_rowlocks_info.out
new file mode 100644
index 0000000000..7f06f55785
--- /dev/null
+++ b/contrib/pgrowlocks/expected/show_rowlocks_info.out
@@ -0,0 +1,17 @@
+Parsed test spec with 2 sessions
+
+starting permutation: s1b s1u1 s2_rowlocks s1c s2_rowlocks
+step s1b: BEGIN;
+step s1u1: UPDATE t1 SET c1 = 2 WHERE c1 = 1;
+step s2_rowlocks: select locked_row, multi, modes from pgrowlocks('t1');
+locked_row|multi|modes            
+----------+-----+-----------------
+(0,1)     |f    |{"No Key Update"}
+(1 row)
+
+step s1c: COMMIT;
+step s2_rowlocks: select locked_row, multi, modes from pgrowlocks('t1');
+locked_row|multi|modes
+----------+-----+-----
+(0 rows)
+
diff --git a/contrib/pgrowlocks/output_iso/results/show_rowlocks_info.out b/contrib/pgrowlocks/output_iso/results/show_rowlocks_info.out
new file mode 100644
index 0000000000..7f06f55785
--- /dev/null
+++ b/contrib/pgrowlocks/output_iso/results/show_rowlocks_info.out
@@ -0,0 +1,17 @@
+Parsed test spec with 2 sessions
+
+starting permutation: s1b s1u1 s2_rowlocks s1c s2_rowlocks
+step s1b: BEGIN;
+step s1u1: UPDATE t1 SET c1 = 2 WHERE c1 = 1;
+step s2_rowlocks: select locked_row, multi, modes from pgrowlocks('t1');
+locked_row|multi|modes            
+----------+-----+-----------------
+(0,1)     |f    |{"No Key Update"}
+(1 row)
+
+step s1c: COMMIT;
+step s2_rowlocks: select locked_row, multi, modes from pgrowlocks('t1');
+locked_row|multi|modes
+----------+-----+-----
+(0 rows)
+
diff --git a/contrib/pgrowlocks/results/pgrowlocks.out b/contrib/pgrowlocks/results/pgrowlocks.out
new file mode 100644
index 0000000000..9daf600e50
--- /dev/null
+++ b/contrib/pgrowlocks/results/pgrowlocks.out
@@ -0,0 +1,28 @@
+--
+-- Test pgrowlocks extension
+--
+CREATE EXTENSION pgrowlocks;
+-- set up
+CREATE TABLE test(c int);
+-- check permission to use pgrowlocks extension;
+CREATE ROLE regress_priv_user1 superuser login;
+CREATE ROLE regress_priv_user2;
+CREATE ROLE regress_priv_user3;
+SET SESSION AUTHORIZATION regress_priv_user1;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+ locked_row | locker | multi | xids | modes 
+------------+--------+-------+------+-------
+(0 rows)
+
+SET SESSION AUTHORIZATION regress_priv_user2;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- fail
+ERROR:  permission denied for table test
+-- switch to superuser
+\c -
+GRANT SELECT ON test TO regress_priv_user3;
+SET SESSION AUTHORIZATION regress_priv_user3;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+ locked_row | locker | multi | xids | modes 
+------------+--------+-------+------+-------
+(0 rows)
+
diff --git a/contrib/pgrowlocks/specs/show_rowlocks_info.spec b/contrib/pgrowlocks/specs/show_rowlocks_info.spec
new file mode 100644
index 0000000000..0d5d629702
--- /dev/null
+++ b/contrib/pgrowlocks/specs/show_rowlocks_info.spec
@@ -0,0 +1,27 @@
+setup
+{   CREATE EXTENSION pgrowlocks;
+
+    DROP TABLE IF EXISTS t1;
+    CREATE TABLE t1(c1 integer);
+
+    INSERT INTO t1 (c1) VALUES (1);
+}
+
+teardown
+{
+    DROP TABLE t1;
+}
+
+session "s1"
+
+step "s1b" { BEGIN; }
+step "s1u1" { UPDATE t1 SET c1 = 2 WHERE c1 = 1; }
+step "s1c" { COMMIT; }
+
+session "s2"
+
+step "s2_rowlocks" { select locked_row, multi, modes from pgrowlocks('t1'); }
+
+
+permutation "s1b" "s1u1" "s2_rowlocks" "s1c" "s2_rowlocks"
+
diff --git a/contrib/pgrowlocks/sql/pgrowlocks.sql b/contrib/pgrowlocks/sql/pgrowlocks.sql
new file mode 100644
index 0000000000..c9ef30a058
--- /dev/null
+++ b/contrib/pgrowlocks/sql/pgrowlocks.sql
@@ -0,0 +1,30 @@
+--
+-- Test pgrowlocks extension
+--
+
+CREATE EXTENSION pgrowlocks;
+
+-- set up
+CREATE TABLE test(c int);
+
+-- check permission to use pgrowlocks extension;
+
+CREATE ROLE regress_priv_user1 superuser login;
+CREATE ROLE regress_priv_user2;
+CREATE ROLE regress_priv_user3;
+
+SET SESSION AUTHORIZATION regress_priv_user1;
+
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+
+SET SESSION AUTHORIZATION regress_priv_user2;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- fail
+
+-- switch to superuser
+\c -
+
+GRANT SELECT ON test TO regress_priv_user3;
+
+SET SESSION AUTHORIZATION regress_priv_user3;
+SELECT locked_row, locker, multi, xids, modes FROM pgrowlocks('test'); -- ok
+
