Created
November 16, 2018 19:36
-
-
Save achampav/450d41673cc5162e9a7cde3021397038 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
declare | |
l_obj record; | |
l_table_name character varying := ''; | |
... | |
begin | |
... | |
for l_obj in select * from pg_event_trigger_ddl_commands() | |
loop | |
if l_obj.command_tag = 'CREATE TABLE' then | |
l_table_name = substr(l_obj.object_identity,position('.' in l_obj.object_identity) + 1); | |
... | |
end loop; | |
... | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment