Re: BUG #16924: Backup and Restore fails for Generated Columns in Declarative Partitioning

From: Henry Hinze <henry(dot)hinze(at)gmail(dot)com>
To: Henry Hinze <henry(dot)hinze(at)googlemail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16924: Backup and Restore fails for Generated Columns in Declarative Partitioning
Date: 2021-03-16 15:43:37
Message-ID: CAJs-y__iw=JUUXxzHkMDcr5d+iFK3j08U7uTEzqWCRQLyq_rXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Any thoughts on this issue?

Best,
Henry

Am Fr., 12. März 2021 um 11:24 Uhr schrieb PG Bug reporting form <
noreply(at)postgresql(dot)org>:

> The following bug has been logged on the website:
>
> Bug reference: 16924
> Logged by: Henry Hinze
> Email address: henry(dot)hinze(at)googlemail(dot)com
> PostgreSQL version: 13.2
> Operating system: Ubuntu 20.04
> Description:
>
> Affected Versions 12.6 and 13.2 (Still working in 12.4)
>
> When dumping and restoring a partitioned table with a generated column the
> column isn't restored. The column stays NULL instead.
>
> How to reproduce:
>
> postgres(at)phobos:~$ psql
> psql (13.2 (Ubuntu 13.2-1.pgdg20.04+1))
> Type "help" for help.
>
> postgres=# create database d1;
> CREATE DATABASE
> postgres=# create database d2;
> CREATE DATABASE
> postgres=# \c d1;
> You are now connected to database "d1" as user "postgres".
> d1=# create table t (c1 int, c2 int generated always as (c1 * 2) stored)
> partition by range (c1);
> CREATE TABLE
> d1=# create table t1 partition of t for values from (1) to (2);
> CREATE TABLE
> d1=# create table t2 partition of t for values from (2) to (3);
> CREATE TABLE
> d1=# insert into t (c1) values (1), (2);
> INSERT 0 2
> d1=# select * from t;
> c1 | c2
> ----+----
> 1 | 2
> 2 | 4
> (2 rows)
>
> d1=# \q
> postgres(at)phobos:~$ pg_dump d1 | psql d2
> SET
> SET
> SET
> SET
> SET
> set_config
> ------------
>
> (1 row)
>
> SET
> SET
> SET
> SET
> SET
> CREATE TABLE
> ALTER TABLE
> SET
> CREATE TABLE
> ALTER TABLE
> ALTER TABLE
> CREATE TABLE
> ALTER TABLE
> ALTER TABLE
> COPY 1
> COPY 1
> postgres(at)phobos:~$ psql d2
> psql (13.2 (Ubuntu 13.2-1.pgdg20.04+1))
> Type "help" for help.
>
> d2=# select * from t;
> c1 | c2
> ----+----
> 1 |
> 2 |
> (2 rows)
>
> I tested this also on 12.4 where it is still working and showing the
> correct
> result.
> Best,
> Henry
>
>

--
Diplominformatiker Henry Hinze
Dietzgenstraße 75
13156 Berlin
Tel: +49 - 177 - 3160621
USt-ID: DE306639264

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-03-16 16:31:17 Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption
Previous Message Jelte Fennema 2021-03-16 15:34:17 Re: BUG #16160: Minor memory leak in case of starting postgres server with SSL encryption