Re: partitioning and identity column
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-01-22T12:02:30Z
Lists: pgsql-hackers
On 17.01.24 06:36, Ashutosh Bapat wrote:
> On Wed, Jan 17, 2024 at 12:30 AM Peter Eisentraut <peter@eisentraut.org> wrote:
>>
>> On 09.01.24 15:10, Ashutosh Bapat wrote:
>>> Here's complete patch-set.
>>
>> Looks good! Committed.
>>
>
> Thanks a lot Peter.
I found another piece of code that might need updating, or at least the
comment.
In MergeAttributes(), in the part that merges the specified column
definitions into the inherited ones, it says
/*
* Identity is never inherited. The new column can have an
* identity definition, so we always just take that one.
*/
def->identity = newdef->identity;
This is still correct for regular inheritance, but not for partitioning.
I think for partitioning, this is not reachable because you can't
specify identity information when you create a partition(?). So maybe
something like
if (newdef->identity)
{
Assert(!is_partioning);
/*
* Identity is never inherited. The new column can have an
* identity definition, so we always just take that one.
*/
def->identity = newdef->identity;
}
Thoughts?
Commits
-
Fix assorted bugs related to identity column in partitioned tables
- 509199587df7 17.0 landed
-
Remove extra check_stack_depth() from dropconstraint_internal()
- 75bcba6cbd2a 17.0 landed
-
Support identity columns in partitioned tables
- 699586315704 17.0 landed
-
doc: Add Identity Column section under Data Definition chapter
- a37bb7c13995 17.0 landed
-
Assert that partition inherits from only one parent in MergeAttributes()
- d22d98c34171 17.0 landed
-
doc: Decorate PostgreSQL with productname tag
- 58b20e6d75e5 17.0 landed
-
Fix prologue of get_partition_ancestors()
- e557db106ef6 17.0 landed