Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7K4n-0002M4-LT for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Feb 2021 15:28:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7K4m-0004hl-7B for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Feb 2021 15:28:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7K0x-0005Js-8V for pgsql-hackers@lists.postgresql.org; Wed, 03 Feb 2021 15:24:19 +0000 Received: from forward4-smtp.messagingengine.com ([66.111.4.238]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7K0u-0002kA-CX for pgsql-hackers@lists.postgresql.org; Wed, 03 Feb 2021 15:24:18 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.nyi.internal (Postfix) with ESMTP id 0D1461940DC9; Wed, 3 Feb 2021 10:24:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Feb 2021 10:24:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=KQBUrhAqhLeeGEq5vHh8ld4QtLZ/33yRPZTlM6ZqH Ig=; b=wKbDnsxC5YSRQCUfwt5NHZKYD2v+PpTSqmg7wY7aO6BPgMU1ytWuv0bBu C8lp0ExnTzM5oHUo4tSgjr0wvzpY5tl22kfdMfR1FD80P0hqWaXi51R35HMvQSzX PgpMmksjxYKAS75hDhZDwLkjw5j9XB0A/kiEzCccgPyzS5mUXFQrE0W1/yy1USDc 8SKZIHtiwS4FErPA1o9cqV1pxvRVdiK5pG06YighYXvx4o5m2w9E9vLZeI8X3WH5 U4GDkz43NzqRJKR+YoEGj55ddzsvY+J592n1QRuJ/SGqsUk6+/aCFmG+susQ6Xk4 eY8+ocAwL0qUovC2XRDRLJlJYiIQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgedvgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhfhokffffgggjggtgfesthejredttdefjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqh hurggurhgrnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeehgefgvdevkeffheetgfet heetudfgleeggfdtffduhfelheefgfduhfffjeetheenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgpddvnhguqhhurggurhgrnhhtrdgtohhmnecukfhppeekjedrudej jedrieelrddugedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgt ohhm X-ME-Proxy: Received: from april.pezone.net (p57b1458c.dip0.t-ipconnect.de [87.177.69.140]) by mail.messagingengine.com (Postfix) with ESMTPA id 4D79024005D; Wed, 3 Feb 2021 10:24:13 -0500 (EST) Subject: Re: Dumping/restoring fails on inherited generated column To: Tom Lane References: <15830.1575468847@sss.pgh.pa.us> <31905.1575491779@sss.pgh.pa.us> <24369.1580758361@sss.pgh.pa.us> <3f272982-0e0d-17a1-3fb6-fedc74197676@2ndquadrant.com> <3169466.1594841366@sss.pgh.pa.us> <0f57d5e9-4112-1ba8-64d8-c02062c1e95d@postgrespro.ru> <41888c80-e5bd-f9e5-75dc-fb377113168c@2ndquadrant.com> <2808494.1611938475@sss.pgh.pa.us> Cc: Anastasia Lubennikova , Masahiko Sawada , Masahiko Sawada , PostgreSQL Hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <2903e1ce-0765-cbeb-dd58-8fab7f6596a3@2ndquadrant.com> Date: Wed, 3 Feb 2021 16:24:12 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <2808494.1611938475@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-01-29 17:41, Tom Lane wrote: > However ... this doesn't solve all the cases noted in this thread. > In the first example I gave at [1], > > d3=# create table parent (f1 int default 2); > CREATE TABLE > d3=# create table child (f1 int default 3) inherits(parent); > NOTICE: merging column "f1" with inherited definition > CREATE TABLE > d3=# create table child2() inherits(parent); > CREATE TABLE > d3=# alter table child2 alter column f1 set default 42; > ALTER TABLE > > pg_dump still fails to restore child2.f1's non-inherited default. > That's probably a pre-existing problem, since it doesn't involve > GENERATED at all, but we shouldn't forget about it. > [1] https://www.postgresql.org/message-id/660925.1601397436%40sss.pgh.pa.us I can't tell what the problem is in this example. I tried with PG11, 12, and master, and the schema dump comes out with those same four commands and they restore correctly AFAICT. -- Peter Eisentraut 2ndQuadrant, an EDB company https://www.2ndquadrant.com/