standbycheck.patch

text/x-patch

Filename: standbycheck.patch
Type: text/x-patch
Part: 0
Message: Re: testing hot standby

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
src/test/regress/expected/hs_standby_disallowed.out 30 30
src/test/regress/expected/hs_standby_functions.out 1 1
Index: src/test/regress/expected/hs_standby_disallowed.out
===================================================================
RCS file: /home/postgres/pg_repo/pgsql/src/test/regress/expected/hs_standby_disallowed.out,v
retrieving revision 1.1
diff -c -r1.1 hs_standby_disallowed.out
*** src/test/regress/expected/hs_standby_disallowed.out	19 Dec 2009 01:32:45 -0000	1.1
--- src/test/regress/expected/hs_standby_disallowed.out	10 Apr 2010 04:26:48 -0000
***************
*** 11,50 ****
  WARNING:  there is no transaction in progress
  -- SELECT
  select * from hs1 FOR SHARE;
! ERROR:  transaction is read-only
  select * from hs1 FOR UPDATE;
! ERROR:  transaction is read-only
  -- DML
  BEGIN;
  insert into hs1 values (37);
! ERROR:  transaction is read-only
  ROLLBACK;
  BEGIN;
  delete from hs1 where col1 = 1;
! ERROR:  transaction is read-only
  ROLLBACK;
  BEGIN;
  update hs1 set col1 = NULL where col1 > 0;
! ERROR:  transaction is read-only
  ROLLBACK;
  BEGIN;
  truncate hs3;
! ERROR:  transaction is read-only
  ROLLBACK;
  -- DDL
  create temporary table hstemp1 (col1 integer);
! ERROR:  transaction is read-only
  BEGIN;
  drop table hs2;
! ERROR:  transaction is read-only
  ROLLBACK;
  BEGIN;
  create table hs4 (col1 integer);
! ERROR:  transaction is read-only
  ROLLBACK;
  -- Sequences
  SELECT nextval('hsseq');
! ERROR:  cannot be executed during recovery
  -- Two-phase commit transaction stuff
  BEGIN;
  SELECT count(*) FROM hs1;
--- 11,50 ----
  WARNING:  there is no transaction in progress
  -- SELECT
  select * from hs1 FOR SHARE;
! ERROR:  cannot execute SELECT FOR SHARE in a read-only transaction
  select * from hs1 FOR UPDATE;
! ERROR:  cannot execute SELECT FOR UPDATE in a read-only transaction
  -- DML
  BEGIN;
  insert into hs1 values (37);
! ERROR:  cannot execute INSERT in a read-only transaction
  ROLLBACK;
  BEGIN;
  delete from hs1 where col1 = 1;
! ERROR:  cannot execute DELETE in a read-only transaction
  ROLLBACK;
  BEGIN;
  update hs1 set col1 = NULL where col1 > 0;
! ERROR:  cannot execute UPDATE in a read-only transaction
  ROLLBACK;
  BEGIN;
  truncate hs3;
! ERROR:  cannot execute TRUNCATE TABLE in a read-only transaction
  ROLLBACK;
  -- DDL
  create temporary table hstemp1 (col1 integer);
! ERROR:  cannot execute CREATE TABLE in a read-only transaction
  BEGIN;
  drop table hs2;
! ERROR:  cannot execute DROP TABLE in a read-only transaction
  ROLLBACK;
  BEGIN;
  create table hs4 (col1 integer);
! ERROR:  cannot execute CREATE TABLE in a read-only transaction
  ROLLBACK;
  -- Sequences
  SELECT nextval('hsseq');
! ERROR:  cannot execute nextval() in a read-only transaction
  -- Two-phase commit transaction stuff
  BEGIN;
  SELECT count(*) FROM hs1;
***************
*** 54,60 ****
  (1 row)
  
  PREPARE TRANSACTION 'foobar';
! ERROR:  cannot be executed during recovery
  ROLLBACK;
  BEGIN;
  SELECT count(*) FROM hs1;
--- 54,60 ----
  (1 row)
  
  PREPARE TRANSACTION 'foobar';
! ERROR:  cannot execute PREPARE TRANSACTION during recovery
  ROLLBACK;
  BEGIN;
  SELECT count(*) FROM hs1;
***************
*** 64,70 ****
  (1 row)
  
  COMMIT PREPARED 'foobar';
! ERROR:  cannot be executed during recovery
  ROLLBACK;
  BEGIN;
  SELECT count(*) FROM hs1;
--- 64,70 ----
  (1 row)
  
  COMMIT PREPARED 'foobar';
! ERROR:  COMMIT PREPARED cannot run inside a transaction block
  ROLLBACK;
  BEGIN;
  SELECT count(*) FROM hs1;
***************
*** 74,80 ****
  (1 row)
  
  PREPARE TRANSACTION 'foobar';
! ERROR:  cannot be executed during recovery
  ROLLBACK PREPARED 'foobar';
  ERROR:  current transaction is aborted, commands ignored until end of transaction block
  ROLLBACK;
--- 74,80 ----
  (1 row)
  
  PREPARE TRANSACTION 'foobar';
! ERROR:  cannot execute PREPARE TRANSACTION during recovery
  ROLLBACK PREPARED 'foobar';
  ERROR:  current transaction is aborted, commands ignored until end of transaction block
  ROLLBACK;
***************
*** 86,137 ****
  (1 row)
  
  ROLLBACK PREPARED 'foobar';
! ERROR:  cannot be executed during recovery
  ROLLBACK;
  -- Locks
  BEGIN;
  LOCK hs1;
! ERROR:  cannot be executed during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE UPDATE EXCLUSIVE MODE;
! ERROR:  cannot be executed during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE MODE;
! ERROR:  cannot be executed during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE ROW EXCLUSIVE MODE;
! ERROR:  cannot be executed during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN EXCLUSIVE MODE;
! ERROR:  cannot be executed during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN ACCESS EXCLUSIVE MODE;
! ERROR:  cannot be executed during recovery
  COMMIT;
  -- Listen
  listen a;
! ERROR:  cannot be executed during recovery
  notify a;
! ERROR:  cannot be executed during recovery
  unlisten a;
! ERROR:  cannot be executed during recovery
  unlisten *;
! ERROR:  cannot be executed during recovery
  -- disallowed commands
  ANALYZE hs1;
! ERROR:  cannot be executed during recovery
  VACUUM hs2;
! ERROR:  cannot be executed during recovery
  CLUSTER hs2 using hs1_pkey;
! ERROR:  cannot be executed during recovery
  REINDEX TABLE hs2;
! ERROR:  cannot be executed during recovery
  REVOKE SELECT ON hs1 FROM PUBLIC;
! ERROR:  transaction is read-only
  GRANT SELECT ON hs1 TO PUBLIC;
! ERROR:  transaction is read-only
--- 86,137 ----
  (1 row)
  
  ROLLBACK PREPARED 'foobar';
! ERROR:  ROLLBACK PREPARED cannot run inside a transaction block
  ROLLBACK;
  -- Locks
  BEGIN;
  LOCK hs1;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE UPDATE EXCLUSIVE MODE;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE MODE;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN SHARE ROW EXCLUSIVE MODE;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN EXCLUSIVE MODE;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  BEGIN;
  LOCK hs1 IN ACCESS EXCLUSIVE MODE;
! ERROR:  cannot execute LOCK TABLE during recovery
  COMMIT;
  -- Listen
  listen a;
! ERROR:  cannot execute LISTEN during recovery
  notify a;
! ERROR:  cannot execute NOTIFY during recovery
  unlisten a;
! ERROR:  cannot execute UNLISTEN during recovery
  unlisten *;
! ERROR:  cannot execute UNLISTEN during recovery
  -- disallowed commands
  ANALYZE hs1;
! ERROR:  cannot execute VACUUM during recovery
  VACUUM hs2;
! ERROR:  cannot execute VACUUM during recovery
  CLUSTER hs2 using hs1_pkey;
! ERROR:  cannot execute CLUSTER during recovery
  REINDEX TABLE hs2;
! ERROR:  cannot execute REINDEX during recovery
  REVOKE SELECT ON hs1 FROM PUBLIC;
! ERROR:  cannot execute REVOKE in a read-only transaction
  GRANT SELECT ON hs1 TO PUBLIC;
! ERROR:  cannot execute GRANT in a read-only transaction
Index: src/test/regress/expected/hs_standby_functions.out
===================================================================
RCS file: /home/postgres/pg_repo/pgsql/src/test/regress/expected/hs_standby_functions.out,v
retrieving revision 1.1
diff -c -r1.1 hs_standby_functions.out
*** src/test/regress/expected/hs_standby_functions.out	19 Dec 2009 01:32:45 -0000	1.1
--- src/test/regress/expected/hs_standby_functions.out	10 Apr 2010 04:28:25 -0000
***************
*** 5,11 ****
  --
  -- should fail
  select txid_current();
! ERROR:  cannot be executed during recovery
  select length(txid_current_snapshot()::text) >= 4;
   ?column? 
  ----------
--- 5,11 ----
  --
  -- should fail
  select txid_current();
! ERROR:  cannot execute txid_current() during recovery
  select length(txid_current_snapshot()::text) >= 4;
   ?column? 
  ----------