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-22T18:59:32Z
Lists: pgsql-hackers
On 22.01.24 13:23, Ashutosh Bapat wrote:
>>       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?
> 
> That code block already has Assert(!is_partition) at line 3085. I
> thought that Assert is enough.

Ok.  Maybe just rephrase that comment somehow then?

> There's another thing I found. The file isn't using
> check_stack_depth() in the function which traverse inheritance
> hierarchies. This isn't just a problem of the identity related
> function but most of the functions in that file. Do you think it's
> worth fixing it?

I suppose the number of inheritance levels is usually not a problem for 
stack depth?




Commits

  1. Fix assorted bugs related to identity column in partitioned tables

  2. Remove extra check_stack_depth() from dropconstraint_internal()

  3. Support identity columns in partitioned tables

  4. doc: Add Identity Column section under Data Definition chapter

  5. Assert that partition inherits from only one parent in MergeAttributes()

  6. doc: Decorate PostgreSQL with productname tag

  7. Fix prologue of get_partition_ancestors()