From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory
Date: Mon, 10 Jan 2022 16:29:46 -0500
Message-ID: <2412212.1641850186@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwagvaUqqj1hyQXMU8Koqzj0ZK6Q61DJDvYzn-dw0otT9A@mail.gmail.com>
References: <CAFCRh-9jU41R3WV0BOAf55KFuN4_ePzQ_TBjeDMq82e0yic7DA@mail.gmail.com>
<2208869.1641836366@sss.pgh.pa.us>
<CAFCRh-_MOjdz8M-wOL-xZiLrUtUkE_q6iAcNxPXg8xRxyBJffA@mail.gmail.com>
<CAFCRh--no2WL5OhSndVo=dkCfA7OAoEDd7wJPqj+QAxp7TqnaA@mail.gmail.com>
<CAKFQuwagvaUqqj1hyQXMU8Koqzj0ZK6Q61DJDvYzn-dw0otT9A@mail.gmail.com>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Jan 10, 2022 at 12:09 PM Dominique Devienne <ddevienne@gmail.com>
> wrote:
>> Tom wrote "relation" for the number of locks necessary for DROP OWNED BY.
>> What does it mean in this context? relation = table?
> I'm confused here a bit as well. The items being talked about are tables
> and indexes, both of which manifest as files on the filesystem. But not
> all relations do (e.g., views). But if this isn't tied to the filesystem
> then I would expect that other object types, especially functions, would
> require locking as well, but those are decidedly not relations.
I was wrong actually --- I wrote that thinking that we acquire exclusive
lock when dropping a relation (where relation may be defined as "something
with a pg_class entry"). That's true, but these days we acquire a lock
when deleting *any* cataloged database object. So you'd also need a lock
for each schema, function, etc that was due to get dropped. This is
basically to avoid problems in case of concurrent drop commands.
It's still true that the size of a relation in columns or rows is not
relevant here.
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, david.g.johnston@gmail.com, ddevienne@gmail.com
Subject: Re: DROP OWNED BY fails with #53200: ERROR: out of shared memory
In-Reply-To: <2412212.1641850186@sss.pgh.pa.us>
References: <CAFCRh-9jU41R3WV0BOAf55KFuN4_ePzQ_TBjeDMq82e0yic7DA@mail.gmail.com> <2208869.1641836366@sss.pgh.pa.us> <CAFCRh-_MOjdz8M-wOL-xZiLrUtUkE_q6iAcNxPXg8xRxyBJffA@mail.gmail.com> <CAFCRh--no2WL5OhSndVo=dkCfA7OAoEDd7wJPqj+QAxp7TqnaA@mail.gmail.com> <CAKFQuwagvaUqqj1hyQXMU8Koqzj0ZK6Q61DJDvYzn-dw0otT9A@mail.gmail.com> <2412212.1641850186@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