Re: partitioning and identity column
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Peter Eisentraut <peter@eisentraut.org>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-26T18:00:01Z
Lists: pgsql-hackers
26.04.2024 15:57, Ashutosh Bapat wrote: > Thanks Alexander for the report. > > On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin <exclusion@gmail.com> wrote: > > > CREATE TABLE tbl3 (LIKE tbl2 INCLUDING IDENTITY); > ERROR: no owned sequence found > > > I don't think creating a table like a partition is common or even useful. Usually it would create it from partitithe > oned table. But if we consider that to be a use case, I think the error is expected since a partition doesn't have its > own identity; it shares it with the partitioned table. Maybe we could give a better message. But I will look into this > and fix it if the solution makes sense. Maybe it's uncommon, but it's allowed, so users may want to CREATE TABLE sometable (LIKE partX INCLUDING ALL), for example, if the partition has a somewhat different structure. And thinking about how such a restriction could be described in the docs, I would prefer to avoid this error at the implementation level. > > Do you want to track this in open items? > If you are inclined to fix this behavior, I would add this item. Best regards, Alexander
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