Skip to content

Instantly share code, notes, and snippets.

@akramarev
Created July 12, 2022 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akramarev/57d8900b196921a604f2a3cd0498cd48 to your computer and use it in GitHub Desktop.
Save akramarev/57d8900b196921a604f2a3cd0498cd48 to your computer and use it in GitHub Desktop.
[disable triggers and FK checks in postgres]
-- If SET (or equivalently SET SESSION) is issued within a transaction that is later aborted, the effects of the SET command disappear when the transaction is rolled back. Once the surrounding transaction is committed, the effects will persist until the end of the session, unless overridden by another SET.
SET session_replication_role = 'replica';
...
SET session_replication_role = 'origin';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment