maximum number of triggers on a table?

Started by Nonameover 23 years ago4 messagesgeneral
Jump to latest
#1Noname
derek@spencerogne.com

Does Postgresql have a limit on the number of triggers that can exist
on any given table? We're using v7.2.3.

I have a table with 36 triggers and upon adding another trigger
(really a foreign key reference) the alter table query hangs and
doesn't return...

I tried to find a reference to this in the documentation or FAQ but
was not successful.

-Derek

#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Noname (#1)
Re: maximum number of triggers on a table?

On 29 Oct 2002, Derek Spencer wrote:

Does Postgresql have a limit on the number of triggers that can exist
on any given table? We're using v7.2.3.

I have a table with 36 triggers and upon adding another trigger
(really a foreign key reference) the alter table query hangs and
doesn't return...

I don't know of a trigger limit, but does this table have data in it?
It's possible that the alter table is being slow in checking the initial
state of the constraint.

#3Robert Treat
xzilla@users.sourceforge.net
In reply to: Noname (#1)
Re: maximum number of triggers on a table?

I don't know of any limit on triggers allowed, and looking at my
development server I have a couple tables with more than 36 (one has
100+) though the majority of this are RI triggers. Can you post the sql
involved?

Robert Treat

Show quoted text

On Tue, 2002-10-29 at 18:50, Derek Spencer wrote:

Does Postgresql have a limit on the number of triggers that can exist
on any given table? We're using v7.2.3.

I have a table with 36 triggers and upon adding another trigger
(really a foreign key reference) the alter table query hangs and
doesn't return...

I tried to find a reference to this in the documentation or FAQ but
was not successful.

-Derek

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephan Szabo (#2)
Re: maximum number of triggers on a table?

Stephan Szabo <sszabo@megazone23.bigpanda.com> writes:

I have a table with 36 triggers and upon adding another trigger
(really a foreign key reference) the alter table query hangs and
doesn't return...

I don't know of a trigger limit, but does this table have data in it?
It's possible that the alter table is being slow in checking the initial
state of the constraint.

I'm wondering if the ALTER is waiting to acquire lock on the referenced
table (it will need exclusive lock to add the trigger). If some open
transaction has used the referenced table and is now sitting around
without committing, it would cause the above behavior.

regards, tom lane