| -- |
| -- Hot Standby tests |
| -- |
| -- hs_standby_disallowed.sql |
| -- |
| SET transaction_read_only = off; |
| ERROR: cannot set transaction read-write mode during recovery |
| begin transaction read write; |
| ERROR: cannot set transaction read-write mode during recovery |
| commit; |
| WARNING: there is no transaction in progress |
| -- SELECT |
| select * from hs1 FOR SHARE; |
| ERROR: cannot acquire lock mode ExclusiveLock on database objects while recovery is in progress |
| LINE 1: select * from hs1 FOR SHARE; |
| ^ |
| HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery. |
| select * from hs1 FOR UPDATE; |
| ERROR: cannot acquire lock mode ExclusiveLock on database objects while recovery is in progress |
| LINE 1: select * from hs1 FOR UPDATE; |
| ^ |
| HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery. |
| -- 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 acquire lock mode ExclusiveLock on database objects while recovery is in progress |
| LINE 1: delete from hs1 where col1 = 1; |
| ^ |
| HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery. |
| ROLLBACK; |
| BEGIN; |
| update hs1 set col1 = NULL where col1 > 0; |
| ERROR: cannot acquire lock mode ExclusiveLock on database objects while recovery is in progress |
| LINE 1: update hs1 set col1 = NULL where col1 > 0; |
| ^ |
| HINT: Only RowExclusiveLock or less can be acquired on database objects during recovery. |
| 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; |
| count |
| ------- |
| 1 |
| (1 row) |
| |
| PREPARE TRANSACTION 'foobar'; |
| ERROR: cannot execute PREPARE TRANSACTION during recovery |
| ROLLBACK; |
| BEGIN; |
| SELECT count(*) FROM hs1; |
| count |
| ------- |
| 1 |
| (1 row) |
| |
| COMMIT PREPARED 'foobar'; |
| ERROR: cannot execute COMMIT PREPARED during recovery |
| ROLLBACK; |
| BEGIN; |
| SELECT count(*) FROM hs1; |
| count |
| ------- |
| 1 |
| (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; |
| BEGIN; |
| SELECT count(*) FROM hs1; |
| count |
| ------- |
| 1 |
| (1 row) |
| |
| ROLLBACK PREPARED 'foobar'; |
| ERROR: cannot execute ROLLBACK PREPARED during recovery |
| 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 |
| -- disallowed commands |
| ANALYZE hs1; |
| ERROR: cannot execute ANALYZE 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 |
| -- GPDB: backward fetch is not supported, moved from hs_standby_allowed. |
| BEGIN; |
| DECLARE hsc CURSOR FOR select * from hs3 order by col1 asc; |
| fetch next from hsc; |
| col1 |
| ------ |
| 113 |
| (1 row) |
| |
| fetch first from hsc; |
| ERROR: backward scan is not supported in this version of Apache Cloudberry |
| COMMIT; |