Last active
September 24, 2025 14:53
-
-
Save cgimenes/f93a0172cb2d9b7ac45d5833d79a9555 to your computer and use it in GitHub Desktop.
Check if inside a transaction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TEMPORARY TABLE a (b int) ON COMMIT DROP; | |
| SELECT pg_current_xact_id_if_assigned() IS NOT NULL AS is_transaction; | |
| -- source: https://dba.stackexchange.com/a/311714 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment