| From: | Nitin Motiani <nitinmotiani(at)google(dot)com> |
|---|---|
| To: | jian he <jian(dot)universality(at)gmail(dot)com> |
| Cc: | assam258(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: [PATCH v1] Fix for bug #19773 : pg_dump differing generation expressions of inherited columns |
| Date: | 2026-11-17 12:59:35 |
| Message-ID: | CAH5HC94vOHs6L93kyGurgRaVdHj_HQthWYtNAg6LtqM+eho8oA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi all,
Thanks for the reviews. v3 is attached, rebased on current master.
> One small comment on the code: the new field
> maybe_dump_later_if_altered_expression is much longer than its
> neighbours in AttrDefInfo (adtable, adnum, adef_expr, separate), and
> it names what may happen later rather than the state it records. A
> shorter name such as inherited_expr, with the existing comment
> explaining it, would read better next to separate.
The only change from v2 is that the flag is renamed to
inherit_unless_altered, as Henson suggested. I wanted to name the flag
such that it's clear to the reader that the decision can change later
depending on whether the expression was altered or not so went with
the original larger name and now this one.
> I didn't look at the whole patch and don't intend to review. I noticed
> that this patch adds tests to pg_dump TAP test. Instead, we should
> check whether we can leverage 002_pg_upgrade for this testing - if
> there are test in regression suite that render the objects in the
> required state, leave them in regression database at the end. If the
> tests do not do that, probably we are missing respective DDL coverage
> in regression suite itself.
I tried the 002_pg_upgrade route, but its dump comparison can't catch
this bug. pg_dump leaves out the child's expression in both the
original dump and the dump of the restored database, so the two match
even though the restored child is wrong. pg_upgrade isn't affected
either, since binary-upgrade mode dumps every column with its own
expression. So I've kept the TAP tests, which check pg_dump's output
directly.
On Wed, Nov 4, 2026 at 5:50 PM jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> ALTER COLUMN SET EXPRESSION
> has some problems with dependencies, see [1] and [2]
>
> [1]: https://www.postgresql.org/message-id/CACJufxEXY8O5rPLoieo1WoqbuO2ajCEJzVkXcykNtsyij8rEyA%40mail.gmail.com
> [2]: https://www.postgresql.org/message-id/flat/CACJufxEomSz3BwUGfk8A6MeAKj%3DCki5B%2BgYTbJO%3DACCJyytWZg%40mail.gmail.com
>
Thanks for the pointers. I tested the v4 patches from [1]. With either
one, ALTER TABLE ONLY ... SET EXPRESSION fails on a child with
constraints on the column, so restoring such dumps would fail. I'll
also raise it on that thread.
Regards,
Nitin Motiani
Google
| Attachment | Content-Type | Size |
|---|---|---|
| v3-0001-pg_dump-Dump-differing-generation-expressions-of-.patch | application/x-patch | 20.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Nitin Motiani | 2026-11-17 13:02:02 | Re: ALTER COLUMN SET EXPRESSION on partitions not work in case of constraint dependencies |
| Previous Message | Andrey Borodin | 2026-11-17 12:53:55 | Re: amcheck: add index-all-keys-match verification for B-Tree |