pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: andrewbille@gmail.com, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Dumping/restoring fails on inherited generated column
Date: Tue, 29 Sep 2020 16:17:05 -0400
Message-ID: <718578.1601410625@sss.pgh.pa.us> (raw)
In-Reply-To: <6569EA45-268E-4635-B633-BEC5C2F73F4A@yesql.se>
References: <15830.1575468847@sss.pgh.pa.us>
	<fd559544-274c-f514-d8bf-358d2c539455@2ndquadrant.com>
	<31905.1575491779@sss.pgh.pa.us>
	<d6ebcc2e-3e6f-6915-6616-70ef665aed66@2ndquadrant.com>
	<24369.1580758361@sss.pgh.pa.us>
	<b1c831dd-d520-5e7f-0304-0eeed39c9996@2ndquadrant.com>
	<CA+fd4k4cHKUmEyHiPHx0QL3T-DXAP8O1CP-hUvo1WX6RwNC=tA@mail.gmail.com>
	<3f272982-0e0d-17a1-3fb6-fedc74197676@2ndquadrant.com>
	<c9848634-76c1-3c21-fc19-f1b7eebb640f@2ndquadrant.com>
	<3169466.1594841366@sss.pgh.pa.us>
	<CA+fd4k4fck6xzsF8mPWeVSZFBLtiA2cQxrPqBaYcoZGc+hZ=JQ@mail.gmail.com>
	<CA+fd4k6pLzrZDQsdsxcS06AwGRf1DgwOw84sFq9oXNw+83nB1g@mail.gmail.com>
	<bf846641-b695-d095-f3d1-f362d58c7296@2ndquadrant.com>
	<CA+fd4k5BZJxKCKod8r+Zm0SpLHqaS9f56WhGx_i2vKDf_ftqXQ@mail.gmail.com>
	<660925.1601397436@sss.pgh.pa.us>
	<6569EA45-268E-4635-B633-BEC5C2F73F4A@yesql.se>

Daniel Gustafsson <daniel@yesql.se> writes:
> On 29 Sep 2020, at 18:37, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> This does not cause child2.f1's attislocal property to become
>> true.  Maybe it should have, but it's probably too late for
>> that; at least, pg_dump couldn't assume it's true in older
>> servers.  

> Do you recall the rationale for it not being set to true?  I didn't spot
> anything in the commit history. Intuitively it seems a tad odd.

I'd bet the explanation is mostly that it didn't occur to anyone
that SET DEFAULT should do that.  I'm not really proposing that it
should either.  If we were to make any catalog changes in response
to this, what I'd vote for is to add an "inherited" flag to
pg_attrdef.  (I'm not quite sure if a bool would be sufficient,
or if we'd need to go to the same extent as pg_attribute does,
and have a bool plus an inheritance count.)

Of course, that line of thought does not lead to anything
back-patchable.  But pg_dump would have to be prepared to cope
with the situation in older servers in any case.

			regards, tom lane





view thread (37+ messages)  latest in thread

Message-ID: <718578.1601410625@sss.pgh.pa.us>
Permalink:  ../718578.1601410625@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/718578.1601410625@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, daniel@yesql.se, masahiko.sawada@2ndquadrant.com, peter.eisentraut@2ndquadrant.com
  Subject: Re: Dumping/restoring fails on inherited generated column
  In-Reply-To: <718578.1601410625@sss.pgh.pa.us>
  References: <15830.1575468847@sss.pgh.pa.us> <fd559544-274c-f514-d8bf-358d2c539455@2ndquadrant.com> <31905.1575491779@sss.pgh.pa.us> <d6ebcc2e-3e6f-6915-6616-70ef665aed66@2ndquadrant.com> <24369.1580758361@sss.pgh.pa.us> <b1c831dd-d520-5e7f-0304-0eeed39c9996@2ndquadrant.com> <CA+fd4k4cHKUmEyHiPHx0QL3T-DXAP8O1CP-hUvo1WX6RwNC=tA@mail.gmail.com> <3f272982-0e0d-17a1-3fb6-fedc74197676@2ndquadrant.com> <c9848634-76c1-3c21-fc19-f1b7eebb640f@2ndquadrant.com> <3169466.1594841366@sss.pgh.pa.us> <CA+fd4k4fck6xzsF8mPWeVSZFBLtiA2cQxrPqBaYcoZGc+hZ=JQ@mail.gmail.com> <CA+fd4k6pLzrZDQsdsxcS06AwGRf1DgwOw84sFq9oXNw+83nB1g@mail.gmail.com> <bf846641-b695-d095-f3d1-f362d58c7296@2ndquadrant.com> <CA+fd4k5BZJxKCKod8r+Zm0SpLHqaS9f56WhGx_i2vKDf_ftqXQ@mail.gmail.com> <660925.1601397436@sss.pgh.pa.us> <6569EA45-268E-4635-B633-BEC5C2F73F4A@yesql.se> <718578.1601410625@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox