Get table name with Trigger / Function in Postgres

1

I am implementing a simple replication form of two tables or more. I have the replication table that has the name of the table to be replicated and id.

To feed the replication table I have a trigger on each table that will be replicated by taking the information from them and inserting it into the replication table .

I know that in my function I can use OLD and NEW to get the fields from the table that triggered the trigger, however I wanted to, inside the function trigger the name of the table that triggered the event.

Is this possible?

    
asked by anonymous 11.01.2018 / 18:27

1 answer

1

Looking at the postgres documentation I found how to get, just use the: TG_TABLE_NAME

Postgres Documentation

    
11.01.2018 / 19:12