Through several updates, the CREATE USER command has been separated
from where the user is actually used in the test.
-- should fail
SELECT lastval();
ERROR: lastval is not yet defined in this session
-CREATE USER regress_seq_user;
-- Test sequences in read-only transactions
CREATE TEMPORARY SEQUENCE sequence_test_temp1;
START TRANSACTION READ ONLY;
ERROR: cannot execute setval() in a read-only transaction
ROLLBACK;
-- privileges tests
+CREATE USER regress_seq_user;
-- nextval
BEGIN;
SET LOCAL SESSION AUTHORIZATION regress_seq_user;
-- should fail
SELECT lastval();
-CREATE USER regress_seq_user;
-
-- Test sequences in read-only transactions
CREATE TEMPORARY SEQUENCE sequence_test_temp1;
START TRANSACTION READ ONLY;
-- privileges tests
+CREATE USER regress_seq_user;
+
-- nextval
BEGIN;
SET LOCAL SESSION AUTHORIZATION regress_seq_user;