On Wed, Nov 5, 2025 at 2:31 AM Tom Lane wrote:
>
>
> If it actually matters for DROP EXPRESSION, then the answer is
> probably "we can't use ATSimpleRecursion for DROP EXPRESSION".
> ATSimpleRecursion is meant for cases where each table can be
> processed independently, regardless of its position
I wrote:
> Peter Eisentraut writes:
>> But in ATPrepDropExpression(), when you're recursing, then recurse is
>> always false. That is hardcoded in the ATPrepCmd() call in
>> ATSimpleRecursion(). Does that make sense?
> Seems wrong, but I didn't trace through the code.
Oh: looking closer, the
Peter Eisentraut writes:
> I find that tablecmds.c uses these two arguments in not entirely
> consistent ways.
> I would have expected that if you write a command that is supposed to
> recurse (no ONLY) and you are some levels down into the recursing, then
> recursing=true, of course, but shou
On 25.08.25 15:04, Kirill Reshke wrote:
So we need to detect if the user did ALTER TABLE or ALTER TABLE ONLY.
And we have two parameters passed to ATPrepDropExpression: "recurse"
and "recursing".
First is about whether the user specified ONLY option and second is
about if we are recursing in our
Hi all,
I tried to fix a bug in PostgreSQL where ALTER TABLE ... DROP EXPRESSION
fails on multi-level inheritance hierarchies.
Bug:
When a parent table has a generated column and child/grandchild tables
inherit from it, executing:
ALTER TABLE parent ALTER COLUMN d DROP EXPRESSION;
ERROR: ALTER
On Thu, 28 Aug 2025 at 08:35, jian he wrote:
>
> That means, we don't need to change the ATPrepDropExpression function
> argument for now?
Sure. V3 with this attached, and I think we can move cf entry to RFC
--
Best regards,
Kirill Reshke
v3-0001-Fix-ALTER-TABLE-DROP-EXPRESSION-with-inheritan
On Mon, Aug 25, 2025 at 9:04 PM Kirill Reshke wrote:
>
> Hi!
>
> On Sun, 24 Aug 2025 at 14:05, jian he wrote:
> >
> > hi.
> >
> > --this ALTER COLUMN DROP EXPRESSION work as expected
> > DROP TABLE IF EXISTS parent cascade;
> > CREATE TABLE parent (a int, d INT GENERATED ALWAYS AS (11) STORED);
Looks like no CF entry for this thread.
CF entry [0] created.
[0] https://commitfest.postgresql.org/patch/5992/
--
Best regards,
Kirill Reshke
Hi!
On Sun, 24 Aug 2025 at 14:05, jian he wrote:
>
> hi.
>
> --this ALTER COLUMN DROP EXPRESSION work as expected
> DROP TABLE IF EXISTS parent cascade;
> CREATE TABLE parent (a int, d INT GENERATED ALWAYS AS (11) STORED);
> CREATE TABLE child () INHERITS (parent);
> ALTER TABLE parent ALTER COL