-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a custom setting to control which triggers are invoked for Electr…
…ic writes This gives us control over which triggers fire regardless of whether writes are streamed to Postgres over a logical replication connection or applied directly as DML statements.
- Loading branch information
Showing
4 changed files
with
21 additions
and
10 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
...nts/electric/lib/electric/postgres/extension/functions/__session_replication_role.sql.eex
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE OR REPLACE FUNCTION <%= @schema %>.__session_replication_role(OUT role text) AS $$ | ||
BEGIN | ||
SELECT INTO role current_setting('electric.session_replication_role'); | ||
EXCEPTION WHEN undefined_object THEN | ||
SELECT INTO role current_setting('session_replication_role'); | ||
END; | ||
$$ LANGUAGE PLPGSQL; |
This file contains 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
This file contains 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
This file contains 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