-- txid_snapshot data type and related functions -- Note: these are backward-compatibility functions and types, and have been -- replaced by new xid8-based variants. See xid.sql. The txid variants will -- be removed in a future release.
-- test xid status functions
BEGIN; SELECT txid_current() AS committed \gset COMMIT;
BEGIN; SELECT txid_current() AS rolledback \gset
ROLLBACK;
BEGIN; SELECT txid_current() AS inprogress \gset
SELECT txid_status(:committed) AS committed; SELECT txid_status(:rolledback) AS rolledback; SELECT txid_status(:inprogress) AS inprogress; SELECT txid_status(1); -- BootstrapTransactionId is always committed SELECT txid_status(2); -- FrozenTransactionId is always committed SELECT txid_status(3); -- in regress testing FirstNormalTransactionId will always be behind oldestXmin
COMMIT;
BEGIN; CREATE FUNCTION test_future_xid_status(bigint)
RETURNS void
LANGUAGE plpgsql AS
$$
BEGIN
PERFORM txid_status($1);
RAISE EXCEPTION 'didn''t ERROR at xid in the future as expected';
EXCEPTION WHEN invalid_parameter_value THEN
RAISE NOTICE 'Got expected error for xid in the future';
END;
$$; SELECT test_future_xid_status(:inprogress + 10000);
ROLLBACK;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.