A generated column cannot be part of a partition key - Mailing list pgsql-bugs

From Diego Stammerjohann
Subject A generated column cannot be part of a partition key
Date
Msg-id CAJ7eQr01Gb4iHiGUHAeSxFph76EAjo1up_4SfMzroN_LRZ2a6g@mail.gmail.com
Whole thread Raw
Responses Re: A generated column cannot be part of a partition key
List pgsql-bugs
 Hello,
 
 In the documentation (https://www.postgresql.org/docs/current/ddl-generated-columns.html), there's the following statement:
 
 A generated column cannot be part of a partition key
 
 However, I was able to create a partitioned table using the generated column, as follows:
 
 CREATE TABLE "partitioned_table"
 (
   "id" bigint NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1),
   "text_value" VARCHAR(100) NOT NULL,
   CONSTRAINT "pk_partitioned_table" PRIMARY KEY ("id") WITH (fillfactor='100')
 ) PARTITION BY RANGE ("id");
 
 CREATE TABLE "partition_table_01" PARTITION OF "partitioned_table" FOR VALUES FROM (1)        TO (10000000);
 CREATE TABLE "partition_table_02" PARTITION OF "partitioned_table" FOR VALUES FROM (10000000) TO (20000000);

Diego

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #18549: Support ipv6 link-local addresses in the inet type
Next
From: Aleksander Alekseev
Date:
Subject: Re: Intermittent aggressive use of SWAP space by PostgreSQL despite availability of HUGE amounts of RAM for a small database.