Re: bug: virtual generated column can be partition key

2025-04-23 Thread jian he
On Tue, Apr 22, 2025 at 4:55 PM Ashutosh Bapat wrote: > > Sorry I missed this email while sending the patches - our emails crossed in > the air. > > On Tue, Apr 22, 2025 at 2:15 PM jian he wrote: >> >> On Tue, Apr 22, 2025 at 3:02 PM jian he wrote: >> > Other than that, it looks good to me for

Re: bug: virtual generated column can be partition key

2025-04-22 Thread Ashutosh Bapat
Sorry I missed this email while sending the patches - our emails crossed in the air. On Tue, Apr 22, 2025 at 2:15 PM jian he wrote: > On Tue, Apr 22, 2025 at 3:02 PM jian he > wrote: > > Other than that, it looks good to me for fixing this bug. > > The error message seems not that intuitive. >

Re: bug: virtual generated column can be partition key

2025-04-22 Thread Ashutosh Bapat
Thanks Jian for your review. On Tue, Apr 22, 2025 at 12:32 PM jian he wrote: > On Tue, Apr 22, 2025 at 11:45 AM Ashutosh Bapat > wrote: > > > > I have included your original tests, but ended up rewriting code. Please > let me know what do you think. > > > > + if (attno < 0) > + ereport(ERROR, >

Re: bug: virtual generated column can be partition key

2025-04-22 Thread jian he
On Tue, Apr 22, 2025 at 3:02 PM jian he wrote: > Other than that, it looks good to me for fixing this bug. The error message seems not that intuitive. +CREATE TABLE gtest_part_key (f1 date NOT NULL, f2 bigint, f3 bigint GENERATED ALWAYS AS (f2 * 2) VIRTUAL) PARTITION BY RANGE ((gtest_part_key));

Re: bug: virtual generated column can be partition key

2025-04-22 Thread jian he
On Tue, Apr 22, 2025 at 11:45 AM Ashutosh Bapat wrote: > > I have included your original tests, but ended up rewriting code. Please let > me know what do you think. > + if (attno < 0) + ereport(ERROR, + (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), + errmsg("partition key expressions cannot conta

Re: bug: virtual generated column can be partition key

2025-04-21 Thread Ashutosh Bapat
On Tue, Apr 22, 2025 at 11:19 AM jian he wrote: > On Tue, Apr 22, 2025 at 11:45 AM Ashutosh Bapat > wrote: > > > > > > While looking at this I realised that a generated column may end up > being part of the partition key if the partition key expression contains a > whole row reference. Attached

Re: bug: virtual generated column can be partition key

2025-04-21 Thread jian he
On Tue, Apr 22, 2025 at 11:45 AM Ashutosh Bapat wrote: > > > While looking at this I realised that a generated column may end up being > part of the partition key if the partition key expression contains a whole > row reference. Attached patch also has a fix and a testcase for the same. > PARTI

Re: bug: virtual generated column can be partition key

2025-04-21 Thread Ashutosh Bapat
On Mon, Apr 21, 2025 at 2:42 PM jian he wrote: > On Mon, Apr 21, 2025 at 4:02 PM Fujii Masao > wrote: > > > > > > > > On 2025/04/21 11:30, jian he wrote: > > > hi. > > > While trying to make the virtual generated column be part of the > partition key, > > > I found this bug. > > I noticed that t

Re: bug: virtual generated column can be partition key

2025-04-21 Thread jian he
On Mon, Apr 21, 2025 at 4:02 PM Fujii Masao wrote: > > > > On 2025/04/21 11:30, jian he wrote: > > hi. > > While trying to make the virtual generated column be part of the partition > > key, > > I found this bug. > > I haven't looked at the patch in detail yet, but when I applied it > and ran the

Re: bug: virtual generated column can be partition key

2025-04-21 Thread Fujii Masao
On 2025/04/21 11:30, jian he wrote: hi. While trying to make the virtual generated column be part of the partition key, I found this bug. I haven't looked at the patch in detail yet, but when I applied it and ran the regression tests with RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE ena

bug: virtual generated column can be partition key

2025-04-20 Thread jian he
hi. While trying to make the virtual generated column be part of the partition key, I found this bug. it also influences the stored generated column, i added a test on generated_stored.sql. CREATE TABLE gtest_part_key ( f1 date NOT NULL, f2 bigint, f3 bigint GENERATED ALWAYS AS (f2 * 2) VI