From: Tom Lane <tgl@sss.pgh.pa.us>
To: Maxim Gasumyants <m@gasumyants.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Generated column and partitioning bug
Date: Fri, 04 Feb 2022 14:00:18 -0500
Message-ID: <420367.1644001218@sss.pgh.pa.us> (raw)
In-Reply-To: <E23AA8EE-8B5D-489B-B5FB-F010C89B8B9A@gasumyants.com>
References: <95418DF5-D567-4FFC-A77A-DCE9B985692F@gasumyants.com>
<415297.1643997885@sss.pgh.pa.us>
<E23AA8EE-8B5D-489B-B5FB-F010C89B8B9A@gasumyants.com>
Maxim Gasumyants <m@gasumyants.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
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, m@gasumyants.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Generated column and partitioning bug
In-Reply-To: <420367.1644001218@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox