Created
December 1, 2016 19:44
-
-
Save rupurt/5ac6c2c729a85ddbb11f2c70551ebe0a to your computer and use it in GitHub Desktop.
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
DROP TABLE IF EXISTS test; | |
CREATE TABLE test(); | |
CREATE OR REPLACE FUNCTION dummy_tg() RETURNS TRIGGER | |
LANGUAGE plpgsql AS $$ BEGIN END; $$; | |
BEGIN; | |
CREATE TRIGGER blah BEFORE INSERT ON test FOR EACH ROW EXECUTE PROCEDURE dummy_tg(); | |
SELECT * FROM pg_locks | |
WHERE pid = pg_backend_pid() | |
AND relation = 'test'::regclass; | |
ROLLBACK; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment