Re: shared memory/max_locks_per_transaction error - Mailing list pgsql-general

From Tom Lane
Subject Re: shared memory/max_locks_per_transaction error
Date
Msg-id 27493.1205536331@sss.pgh.pa.us
Whole thread Raw
In response to shared memory/max_locks_per_transaction error  ("Kynn Jones" <kynnjo@gmail.com>)
Responses Re: shared memory/max_locks_per_transaction error  ("Kynn Jones" <kynnjo@gmail.com>)
List pgsql-general
"Kynn Jones" <kynnjo@gmail.com> writes:
> Initially I didn't know what our max_locks_per_transaction was (nor even a
> typical value for it), but in light of the procedure's failure after 3500
> iterations, I figured that it was 3500 or so.  In fact ours is only 64 (the
> default), so I'm now thoroughly confused.

The number of lock slots available system-wide is
max_locks_per_transaction times max_connections, and your procedure was
chewing them all.  I suggest taking the hint's advice if you really need
to create 3500 tables in a single transaction.  Actually, you'd better
do it if you want to have 3500 tables at all, because pg_dump will
certainly try to acquire AccessShare lock on all of them.

> Is there a way to force the release of locks within the loop?

No.

            regards, tom lane

pgsql-general by date:

Previous
From: Clodoaldo
Date:
Subject: Re: Reindex does not finish 8.2.6
Next
From: Russell Smith
Date:
Subject: Re: postgre vs MySQL