create table like including storage parameter

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: create table like including storage parameter
Date: 2025-09-29 00:00:00
Message-ID: CACJufxHr=nKEsS66M7rTHgB+mXdQ948=_eJ1jztAc7PT-eJefA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi.

attached patch is to make CREATE TABLE LIKE copy source relation
storage parameter
demo:

create table t(a text) with (fillfactor = 100, toast.vacuum_truncate=true);
create table t2(like t including storage parameter) with (parallel_workers = 3);

Table "public.t2"
Column | Type | Collation | Nullable | Default | Storage |
Compression | Stats target | Description
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
a | text | | | | extended |
| |
Access method: heap
Options: parallel_workers=3, fillfactor=100, toast.vacuum_truncate=true

of course, duplicate storage mention would result error,
for example:
create table t3(like t including storage parameter) with (fillfactor = 100);

Since we already support INCLUDING STORAGE, I’m not sure that
INCLUDING STORAGE PARAMETER is the right syntax to go with.

Attachment Content-Type Size
v1-0001-create-table-like-incluing-storage-parameter.patch text/x-patch 13.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-09-29 00:15:16 Re: Add support for entry counting in pgstats
Previous Message Peter Smith 2025-09-28 23:39:12 Re: [WIP]Vertical Clustered Index (columnar store extension) - take2