Re: Generated column and partitioning bug

From: Maxim Gasumyants <m(at)gasumyants(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Generated column and partitioning bug
Date: 2022-02-04 20:52:06
Message-ID: D2EAC918-CE2D-4D75-B51D-919C0A0665CB@gasumyants.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

You are right - we were using 12.2, just I didn’t confirmed it well.

Thank you so much, Tom.

> 4 февр. 2022 г., в 21:00, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> написал(а):
>
> Maxim Gasumyants <m(at)gasumyants(dot)com> writes:
>> I will check version once more - I wrote that it latest version based on the thing, that yum does not pull any updates. Here is the command for main table and partitioned table:
>
>> p-# where attrelid = 'products_product_offers'::regclass and attnum > 0;
>> attname | attnum | attisdropped
>> -------------------------------+--------+--------------
>> id | 1 | f
>> shop_id | 2 | f
>> ........pg.dropped.3........ | 3 | t
>> parent_id | 4 | f
>> ........pg.dropped.5........ | 5 | t
>> currency_id | 6 | f
>> article | 7 | f
>> name | 8 | f
>> type | 9 | f
>> image | 10 | f
>> barcodes | 11 | f
>> sku | 12 | f
>> dimensions | 13 | f
>> weight | 14 | f
>> purchasingprice | 15 | f
>
> Hm, I think that confirms my idea about the underlying nature of the bug.
> The parent's stored expression for volume would refer to dimensions as
> being var 13. Now, when you create a new child partition it would have no
> dropped columns, so that dimensions would be column 11 and purchasingprice
> would be column 13 in the child. Thus, the observed symptom is explained
> if we failed to renumber the vars in the GENERATED expression while copying
> it to the child partition.
>
> However, AFAICT we do that correctly. I didn't bisect, but I think
> this was fixed by commit d9253df12, which shipped in PG 12.5.
> Please double-check your server version, eg with "select version();"
>
> regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2022-02-05 03:47:37 Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0
Previous Message Tom Lane 2022-02-04 19:00:18 Re: Generated column and partitioning bug