-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BCF-2882 remove libpq notify (#11738)
* delete unused libpq notify channels * include migration * BCF-2882 lock in no-triggers-allowed with a test * Update core/store/migrate/migrate_test.go Co-authored-by: Jordan Krage <[email protected]> --------- Co-authored-by: Jordan Krage <[email protected]>
- Loading branch information
1 parent
de75c03
commit 9759ff9
Showing
4 changed files
with
52 additions
and
61 deletions.
There are no files selected for viewing
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 was deleted.
Oops, something went wrong.
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
27 changes: 27 additions & 0 deletions
27
core/store/migrate/migrations/0218_drop_log_topic_trigger.sql
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,27 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
DROP TRIGGER IF EXISTS notify_insert_on_logs_topics ON EVM.logs; | ||
DROP FUNCTION IF EXISTS evm.notifysavedlogtopics(); | ||
|
||
-- +goose StatementEnd | ||
|
||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
|
||
CREATE FUNCTION evm.notifysavedlogtopics() RETURNS trigger | ||
LANGUAGE plpgsql | ||
AS $$ | ||
BEGIN | ||
PERFORM pg_notify( | ||
'evm.insert_on_logs'::text, | ||
-- hex encoded address plus comma separated list of hex encoded topic values | ||
-- e.g. "<address>:<topicVal1>,<topicVal2>" | ||
encode(NEW.address, 'hex') || ':' || array_to_string(array(SELECT encode(unnest(NEW.topics), 'hex')), ',') | ||
); | ||
RETURN NULL; | ||
END | ||
$$; | ||
|
||
CREATE TRIGGER notify_insert_on_logs_topics AFTER INSERT ON evm.logs FOR EACH ROW EXECUTE PROCEDURE evm.notifysavedlogtopics(); | ||
-- +goose StatementEnd |