pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow a partdesc-omitting-partitions to be cached
Date: Wed, 28 Apr 2021 19:48:08 +0000
Message-ID: <E1lbqAK-0008Os-1z@gemulon.postgresql.org> (raw)

Allow a partdesc-omitting-partitions to be cached

Makes partition descriptor acquisition faster during the transient
period in which a partition is in the process of being detached.

This also adds the restriction that only one partition can be in
pending-detach state for a partitioned table.

While at it, return find_inheritance_children() API to what it was
before 71f4c8c6f74b, and create a separate
find_inheritance_children_extended() that returns detailed info about
detached partitions.

(This incidentally fixes a bug in 8aba9322511 whereby a memory context
holding a transient partdesc is reparented to a NULL PortalContext,
leading to permanent leak of that memory.  The fix is to no longer rely
on reparenting contexts to PortalContext.   Reported by Amit Langote.)

Per gripe from Amit Langote
Discussion: https://postgr.es/m/CA+HiwqFgpP1LxJZOBYGt9rpvTjXXkg5qG2+Xch2Z1Q7KrqZR1A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d6b8d29419df0efad57f95c80b871745d1b55da6

Modified Files
--------------
doc/src/sgml/ref/alter_table.sgml                  |   2 +
src/backend/catalog/pg_inherits.c                  |  52 +++++++++-
src/backend/commands/tablecmds.c                   |  66 ++++++++-----
src/backend/commands/trigger.c                     |   3 +-
src/backend/partitioning/partdesc.c                | 101 +++++++++++++------
src/backend/utils/cache/relcache.c                 |  33 ++++++-
src/include/catalog/pg_inherits.h                  |   6 +-
src/include/utils/rel.h                            |  15 +++
.../expected/detach-partition-concurrently-3.out   | 110 ++++++++++++++++++++-
.../specs/detach-partition-concurrently-3.spec     |  14 ++-
10 files changed, 329 insertions(+), 73 deletions(-)



Message-ID: <E1lbqAK-0008Os-1z@gemulon.postgresql.org>
Permalink:  ../E1lbqAK-0008Os-1z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lbqAK-0008Os-1z@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Allow a partdesc-omitting-partitions to be cached
  In-Reply-To: <E1lbqAK-0008Os-1z@gemulon.postgresql.org>
  References: <E1lbqAK-0008Os-1z@gemulon.postgresql.org>

* 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