Re: ENABLE / DISABLE ALL TRIGGERS IN DATABASE

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Teemu Juntunen *EXTERN*" <teemu(dot)juntunen(at)e-ngine(dot)fi>, "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: ENABLE / DISABLE ALL TRIGGERS IN DATABASE
Date: 2008-08-27 11:34:10
Message-ID: D960CB61B694CF459DCFB4B0128514C2026E5860@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2008-08-27 11:45:42 Re: loop vs. aggregate was: update and group by/aggregate
Previous Message Ivan Sergio Borgonovo 2008-08-27 11:19:30 Re: loop vs. aggregate was: update and group by/aggregate