agora inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: Fix ALTER COLUMN ... DROP EXPRESSSION with subpartitions
Date: Tue, 4 Aug 2026 09:26:16 +0200
Message-ID: <anGRnFgKM6RFmGLm@alvherre.pgsql> (raw)
In-Reply-To: <DHMT78XOD8BK.341V3H87KZ7NO@gmail.com>
Hello Alberto,
On 2026-Apr-07, Alberto Piai wrote:
> While working on [0], I noticed that DROP EXPRESSION currently refuses
> to be applied to inheritance trees of depth > 2, e.g. when there are
> subpartitions.
Yep, confirmed.
> PFA a fix for this and a test case.
>
> I added the test case to generated_stored.sql,
Looks good. I pushed your fix, with two minor changes:
1. acquiring a lock in the find_inheritance_children() call is
confusing and unnecessary, because ATSimpleRecursion already did it,
so I removed that by passing NoLock.
2. I removed the comment that suggested that the functionality could be
implemented with some effort. This was foreclosed by 8bf6ec3ba3a4,
so the comment is false and wrong.
I also moved the test to the exact spot where ALTER TABLE DROP
EXPRESSION is being tested. That gave me the perfect placement for the
corresponding test for the legacy-inheritance part of the functionality.
The backpatch was pretty straightforward (mostly because git-cherry-pick
figured out by itself that it needed to apply the generated_stored.sql
patch to generated.sql at the point where it was renamed.)
I think you didn't add a commitfest entry for this. Please don't forget
to create one for every patch that you submit; otherwise they're likely
to fall through the cracks. (Though these days the CF process seems
more and more to be a mostly useless, abandoned chore.)
Thanks!
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
<Schwern> It does it in a really, really complicated way
<crab> why does it need to be complicated?
<Schwern> Because it's MakeMaker.
view thread (3+ messages) latest in thread
Message-ID: <anGRnFgKM6RFmGLm@alvherre.pgsql>
Permalink: ../anGRnFgKM6RFmGLm@alvherre.pgsql/
Also on: postgresql.org/message-id/anGRnFgKM6RFmGLm@alvherre.pgsql
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@kurilemu.de, pgsql-hackers@lists.postgresql.org
Subject: Re: Fix ALTER COLUMN ... DROP EXPRESSSION with subpartitions
In-Reply-To: <anGRnFgKM6RFmGLm@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox