Re: ATTACH PARTITION seems to ignore column generation status
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Alexander Lakhin <exclusion@gmail.com>,
Amit Langote <amitlangote09@gmail.com>,
pgsql-hackers@lists.postgresql.org,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2023-02-16T22:40:22Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes: > On 2023-Feb-16, Alexander Lakhin wrote: >> I've encountered a query that triggers an assert added in that commit: >> CREATE TABLE t(a int, b int GENERATED ALWAYS AS (a) STORED) PARTITION BY >> RANGE (a); >> CREATE TABLE tp PARTITION OF t(b DEFAULT 1) FOR VALUES FROM (0) to (1); > It seems wrong that this command is accepted. It should have given an > error, because the partition is not allowed to override the generation > of the value that is specified in the parent table. Agreed. We missed a check somewhere, will fix. regards, tom lane
Commits
-
Fix check for child column generation status matching parent.
- a0fa18cc0d6e 16.0 landed
-
Doc: fix silly thinko in 8bf6ec3ba.
- d93d68aeeaee 16.0 landed
-
Improve handling of inherited GENERATED expressions.
- 8bf6ec3ba3a4 16.0 landed
-
Fix calculation of which GENERATED columns need to be updated.
- ad38e2f89116 13.10 landed
- 8cd190e13a22 14.7 landed
- 3f7836ff651a 16.0 landed
- 3706cc97aa36 15.2 landed