Fix check for child column generation status matching parent.
authorTom Lane
Thu, 16 Feb 2023 23:51:55 +0000 (18:51 -0500)
committerTom Lane
Thu, 16 Feb 2023 23:51:55 +0000 (18:51 -0500)
commita0fa18cc0d6e4dc3dc24b57ae11253356c55d6c4
treeb319724a8ef6720480ef4015b4f3bb5b524a93a3
parentafa7930462f576155a3a6e7716def3db1790fc41
Fix check for child column generation status matching parent.

In commit 8bf6ec3ba, I mistakenly supposed that MergeAttributes'
loop over saved_schema was reprocessing column definitions that
had already been checked earlier: there is a variant syntax for
creating a child partition in which that's not true.  So we need
to duplicate the full check appearing further up.

(Actually, I believe that the "if (restdef->identity)" part is
not reachable, because we reject identity on partitions earlier.
But it seems wise to keep the check, in case that's ever relaxed,
and to keep this code in sync with the other instance.)

Per report from Alexander Lakhin.

Discussion: https://postgr.es/m/4a8200ca-8378-653e-38ed-b2e1f1611aa6@gmail.com
src/backend/commands/tablecmds.c
src/test/regress/expected/generated.out
src/test/regress/sql/generated.sql