Re: disallow alter individual column if partition key contains wholerow reference - Mailing list pgsql-hackers

From jian he
Subject Re: disallow alter individual column if partition key contains wholerow reference
Date
Msg-id CACJufxHP1+wodZeR5q9c+q+SLvJg6H+z3Jo1Sm1Q5cEvOe+b=A@mail.gmail.com
Whole thread Raw
In response to disallow alter individual column if partition key contains wholerow reference  (jian he <jian.universality@gmail.com>)
Responses Re: disallow alter individual column if partition key contains wholerow reference
List pgsql-hackers
On Tue, Apr 22, 2025 at 7:39 PM jian he <jian.universality@gmail.com> wrote:
>
> demo:
> drop table if exists t4;
> CREATE TABLE t4(f1 int, f2 bigint) PARTITION BY list ((t4));
> create table t4_1 partition of t4 for values in ((1,2));
> alter table t4 alter column f2 set data type text using f2;
>
> insert into t4 select 1, '2';
> ERROR: invalid memory alloc request size 18446744073709551615
>
> turns out the fix seems pretty simple, mainly on has_partition_attrs.
> has_partition_attrs is used to
> Checks if any of the 'attnums' is a partition key attribute for rel.
> if partition keys have column references, then has_partition_attrs
> should return true.
>

hi.
minor comments changes,
also add it on commitfest (https://commitfest.postgresql.org/patch/5988)

Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Non-reproducible AIO failure
Next
From: Thomas Munro
Date:
Subject: Re: Non-reproducible AIO failure