Re: ENABLE / DISABLE ALL TRIGGERS IN DATABASE - Mailing list pgsql-general

From Albe Laurenz
Subject Re: ENABLE / DISABLE ALL TRIGGERS IN DATABASE
Date
Msg-id D960CB61B694CF459DCFB4B0128514C2026E5860@exadv11.host.magwien.gv.at
Whole thread Raw
In response to ENABLE / DISABLE ALL TRIGGERS IN DATABASE  ("Teemu Juntunen" <teemu.juntunen@e-ngine.fi>)
List pgsql-general
Teemu Juntunen wrote:
> I think this has been asked before, but I can't find the
> answer from arcive nor google. How to disable/enable all the
> riggers in a database? I have problem with disabled triggers
> after database restore. If there is no simple way, could this
> be made in a function where you find the table names and
> construct the needed commands in strings. If so, how to get
> all the tablenames from database?

Use the information_schema, see
http://www.postgresql.org/docs/current/static/information-schema.html

There is a view called "triggers" that will be useful.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: loop vs. aggregate was: update and group by/aggregate
Next
From: Sam Mason
Date:
Subject: Re: loop vs. aggregate was: update and group by/aggregate