Dominique Devienne <ddevie...@gmail.com> writes:
> I'm trying to DROP a ROLE that has 4 schemas:
> * 2 smallish ones (1 or 2 dozen tables each),
> * 2 largish ones (250 tables, totalling around 4000 columns each).

> And of course there are various indexes, constraints, etc... on each schema.

You're going to need a lock per dropped relation.  The number of
columns or rows doesn't enter into it, but the number of indexes does.

> DDL Error: DROP OWNED BY "Epos-PNS (a73e1fbdcc5b4460ba55703a0d6b6ad7)"
> CASCADE: #53200: ERROR:  out of shared memory
> HINT:  You might need to increase max_locks_per_transaction.

I'd not have expected that when dropping 500-or-so tables, but maybe
you have a lot of indexes per table?

> And please note that there could be dozens even hundreds of largish schemas
> associated to the dropped ROLE (2 + N), not just the 2+2 it fails with here.

There's not a lot of penalty to increasing max_locks_per_transaction,
but no you can't make it "unbounded".

                        regards, tom lane


Reply via email to