Re: Dumping/restoring fails on inherited generated column

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Dumping/restoring fails on inherited generated column
Date: 2021-02-05 14:18:15
Message-ID: 0dbc982e-fbb3-911e-eb80-130494664940@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-02-04 01:17, Zhihong Yu wrote:
> Hi,
> +           if (attribute->attgenerated && !childatt->attgenerated)
> +               ereport(ERROR,
> ...
> +           if (attribute->attgenerated && childatt->attgenerated)
> +           {
>
> Looks like for the second if statement,
> checking attribute->attgenerated should be enough (due to the check from
> the first if statement).

Thanks for taking a look. I figured the way I wrote it makes it easier
to move the code around or insert other code in the future and doesn't
make it so tightly coupled.

Anyway, I figured out how to take account of generation expressions with
different column orders. I used the same approach that we use for check
constraints. The attached patch is good to go from my perspective.

--
Peter Eisentraut
2ndQuadrant, an EDB company
https://www.2ndquadrant.com/

Attachment Content-Type Size
v2-0001-Fix-ALTER-TABLE-INHERIT-with-generated-columns.patch text/plain 6.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-02-05 14:41:41 Re: [HACKERS] Custom compression methods
Previous Message Mark Rofail 2021-02-05 14:17:21 Re: [HACKERS] GSoC 2017: Foreign Key Arrays