I'm bulk loading data and can re-calculate all trigger modifications much more cheaply after the fact than on a row-by-row basis.
How can I temporarily disable all triggers in PostgreSQL?
I'm bulk loading data and can re-calculate all trigger modifications much more cheaply after the fact than on a row-by-row basis.
How can I temporarily disable all triggers in PostgreSQL?
For disable trigger
ALTER TABLE table_name DISABLE TRIGGER trigger_name
For enable trigger
ALTER TABLE table_name ENABLE TRIGGER trigger_name
You can also disable triggers in pgAdmin (III):
A really elegant way to handle this is to create a role that handles database population and set replication for that role:
ALTER ROLE role_name SET session_replication_role = 'replica';
That way you can use that role for populating data and not have to worry about disabling and renabling triggers etc.