recreate_log_trigger(p_tab_attkind text, p_tab_id oid, p_fq_table_name text)

8.84. recreate_log_trigger(p_tab_attkind text, p_tab_id oid, p_fq_table_name text)

Function Properties

Language: PLPGSQL

Return Type: integer

A function that drops and recreates the log trigger on the specified table. It is intended to be used after the primary_key/unique index has changed.

begin
	execute 'drop trigger "_schemadoc_logtrigger" on ' ||
		p_fq_table_name	;
		-- ----
	execute 'create trigger "_schemadoc_logtrigger"' || 
			' after insert or update or delete on ' ||
			p_fq_table_name 
			|| ' for each row execute procedure logTrigger (' ||
                               pg_catalog.quote_literal('_schemadoc') || ',' || 
				pg_catalog.quote_literal(p_tab_id::text) || ',' || 
				pg_catalog.quote_literal(p_tab_attkind) || ');';
	return 0;
end