Обсуждение: create table like including storage parameter

Поиск
Список
Период
Сортировка

create table like including storage parameter

От
jian he
Дата:
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.

Вложения

Re: create table like including storage parameter

От
"David G. Johnston"
Дата:
On Sunday, September 28, 2025, jian he <jian.universality@gmail.com> wrote:
Since we already support INCLUDING STORAGE, I’m not sure that
INCLUDING STORAGE PARAMETER is the right syntax to go with.

I’d just call it “including parameters”; sure, all of the existing ones are storage related, but if there were non-storage ones we’d include those as well, so qualifying with a parameter type doesn’t seem correct.

David J.

Re: create table like including storage parameter

От
jian he
Дата:
On Mon, Sep 29, 2025 at 9:28 AM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Sunday, September 28, 2025, jian he <jian.universality@gmail.com> wrote:
>>
>> Since we already support INCLUDING STORAGE, I’m not sure that
>> INCLUDING STORAGE PARAMETER is the right syntax to go with.
>
> I’d just call it “including parameters”; sure, all of the existing ones are storage related, but if there were
non-storageones we’d include those as well, so qualifying with a parameter type doesn’t seem correct. 
>

“including parameters” would add another keyword "PARAMETERS''.
currently "INCLUDING STORAGE PARAMETER" no need to add a new keyword.
If other people favor “including parameters”, then we can do it that
way in the future.

attached is just a simple rebase of v1.

Вложения