Postgres 9.4以降、以下の関数は独自の名前を返します:
CREATE OR REPLACE FUNCTION your_schema.get_curr_fx_name()
RETURNS text AS $$
DECLARE
stack text; fcesig text;
BEGIN
GET DIAGNOSTICS stack = PG_CONTEXT;
fcesig := substring(stack from 'function (.*?) line');
RETURN fcesig::regprocedure::text;
END;
$$ LANGUAGE plpgsql;