mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-04 14:26:51 +02:00
3a0939eda2
to tests and no changes in accepted server behaviour.
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
--
|
|
-- Hot Standby tests
|
|
--
|
|
-- hs_standby_functions.sql
|
|
--
|
|
-- should fail
|
|
select txid_current();
|
|
ERROR: cannot execute txid_current() during recovery
|
|
select length(txid_current_snapshot()::text) >= 4;
|
|
?column?
|
|
----------
|
|
t
|
|
(1 row)
|
|
|
|
select pg_start_backup('should fail');
|
|
ERROR: recovery is in progress
|
|
HINT: WAL control functions cannot be executed during recovery.
|
|
select pg_switch_xlog();
|
|
ERROR: recovery is in progress
|
|
HINT: WAL control functions cannot be executed during recovery.
|
|
select pg_stop_backup();
|
|
ERROR: recovery is in progress
|
|
HINT: WAL control functions cannot be executed during recovery.
|
|
-- should return no rows
|
|
select * from pg_prepared_xacts;
|
|
transaction | gid | prepared | owner | database
|
|
-------------+-----+----------+-------+----------
|
|
(0 rows)
|
|
|
|
-- just the startup process
|
|
select locktype, virtualxid, virtualtransaction, mode, granted
|
|
from pg_locks where virtualxid = '1/1';
|
|
locktype | virtualxid | virtualtransaction | mode | granted
|
|
------------+------------+--------------------+---------------+---------
|
|
virtualxid | 1/1 | 1/0 | ExclusiveLock | t
|
|
(1 row)
|
|
|
|
-- suicide is painless
|
|
select pg_cancel_backend(pg_backend_pid());
|
|
ERROR: canceling statement due to user request
|