Instantly share code, notes, and snippets.

Embed
What would you like to do?
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