From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory
Date: Mon, 10 Jan 2022 12:39:26 -0500
Message-ID: <2208869.1641836366@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-9jU41R3WV0BOAf55KFuN4_ePzQ_TBjeDMq82e0yic7DA@mail.gmail.com>
References: <CAFCRh-9jU41R3WV0BOAf55KFuN4_ePzQ_TBjeDMq82e0yic7DA@mail.gmail.com>
Dominique Devienne <ddevienne@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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, ddevienne@gmail.com
Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory
In-Reply-To: <2208869.1641836366@sss.pgh.pa.us>
References: <CAFCRh-9jU41R3WV0BOAf55KFuN4_ePzQ_TBjeDMq82e0yic7DA@mail.gmail.com> <2208869.1641836366@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox