public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Ashutosh Bapat <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: partitioning and identity column
Date: Mon, 13 Nov 2023 11:21:43 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAExHW5uOykuTC+C6R1yDSp=o8Q83jr8xJdZxgPkxfZ1Ue5RRGg@mail.gmail.com>
References: <CAExHW5uOykuTC+C6R1yDSp=o8Q83jr8xJdZxgPkxfZ1Ue5RRGg@mail.gmail.com>

On 27.10.23 13:32, Ashutosh Bapat wrote:
> I think we should fix these anomalies as follows
> 1. Allow identity columns to be added to the partitioned table
> irrespective of whether they have partitions of not.
> 2. Propagate identity property to partitions.
> 3. Use the same underlying sequence for getting default value of an
> identity column when INSERTing directly in a partition.
> 4. Disallow attaching a partition with identity column.
> 
> 1 will fix inconsistencies in Behaviour 3 and 4. 2 and 3 will fix
> anomalies in Behaviour 1. 4 will fix Behaviour 2.

This makes sense to me.

Note, here is a writeup about the behavior of generated columns with 
partitioning: 
https://www.postgresql.org/docs/devel/ddl-generated-columns.html.  It 
would be useful if we documented the behavior of identity columns 
similarly.  (I'm not saying the behavior has to match.)

One thing that's not clear to me is what should happen if you have a 
partitioned table with an identity column and you try to attach a 
partition that has its own identity definition for that column.  I 
suppose we shouldn't allow that.  (The equivalent case for generated 
columns is allowed.)







view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: partitioning and identity column
  In-Reply-To: <[email protected]>

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

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