pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT
Date: Thu, 7 Nov 2024 18:54:44 +0100
Message-ID: <202411071754.h3yfmp6vmgjn@alvherre.pgsql> (raw)
In-Reply-To: <CA+HiwqF85f4mgNSYFBMpG_+zv53MDeNg7ZdhNR05B427pvHb5Q@mail.gmail.com>

On 2024-Nov-07, Amit Langote wrote:

> On Wed, Nov 6, 2024 at 9:34 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

> > Oh, hmm, that makes sense I guess.  Still, while this restriction makes
> > sense for inheritance, it doesn't IMO for partitioned tables.  I would
> > even suggest that we drop enforcement of this restriction during ATTACH.
> 
> I agree. Since leaf partitions have no children to propagate
> constraints to, the NO INHERIT mark shouldn't matter. And partitioned
> partitions already disallow NO INHERIT constraints as you mentioned.
> 
> Do you think we should apply something like the attached at least in
> the master?  I found that a similar restriction exists in the CREATE
> TABLE PARTITION OF path too.

Yeah, that sounds reasonable.  I didn't look at the code in detail, but
I'm not sure I understand why you'd change CREATE TABLE PARTITION OF,
since the point is that this restriction would apply when you attach a
table that already exists, not when you create a new table.  Maybe I
misunderstand what you're saying though.

> +1

Thanks, pushed.

> Though if we decide to apply the attached, does the note "not marked
> NO INHERIT" become unnecessary?

Yes -- I think your patch would have to remove it again.  A short-lived
note for sure, but I thought it was better to have all branches in the
same state, and now you can modify master.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





view thread (15+ messages)  latest in thread

Message-ID: <202411071754.h3yfmp6vmgjn@alvherre.pgsql>
Permalink:  ../202411071754.h3yfmp6vmgjn@alvherre.pgsql/
Also on:    postgresql.org/message-id/202411071754.h3yfmp6vmgjn@alvherre.pgsql

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, amitlangote09@gmail.com, pgsql-hackers@lists.postgresql.org, robertmhaas@gmail.com
  Subject: Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT
  In-Reply-To: <202411071754.h3yfmp6vmgjn@alvherre.pgsql>

* 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