Re: partitioning and identity column

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: partitioning and identity column
Date: 2024-04-26 12:57:58
Message-ID: CAExHW5v2WaY1oRCujT8_pBc6eQ6pfR+Gs9x91qxwzrv9Rug3rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks Alexander for the report.

On Fri, Apr 26, 2024 at 5:30 PM Alexander Lakhin <exclusion(at)gmail(dot)com>
wrote:

> Hello Ashutosh and Peter,
>
> 16.01.2024 21:59, Peter Eisentraut wrote:
> > On 09.01.24 15:10, Ashutosh Bapat wrote:
> >> Here's complete patch-set.
> >
> > Looks good! Committed.
> >
>
> Please take a look at a new error case introduced by 699586315:
> CREATE TABLE tbl1 (a int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY)
> PARTITION BY LIST (a);
> CREATE TABLE tbl2 PARTITION OF tbl1 DEFAULT;
>
> 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.

Do you want to track this in open items?

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2024-04-26 13:04:22 Re: BitmapHeapScan streaming read user and prelim refactoring
Previous Message Robert Haas 2024-04-26 12:54:44 Re: some additional (small) problems with pg_combinebackup and tablespaces