How can I SELECT an 'instance' in PostgreSQL?
This is a really bad idea to begin with, you're recreating logical replication. Just refer to the PostgreSQL guide to logical replication.

That said, what you want is the PostgreSQL plpgsql Trigger "special variables.


TG_TABLE_NAME Data type name; the name of the table that caused the trigger invocation.
TG_TABLE_SCHEMA Data type name; the name of the schema of the table that caused the trigger invocation.