Обсуждение: 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.

Вложения

Re: create table like including storage parameter

От
jian he
Дата:
On Wed, Oct 1, 2025 at 2:42 PM jian he <jian.universality@gmail.com> wrote:
>
> “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.

hi.
https://api.cirrus-ci.com/v1/artifact/task/5202996067303424/testrun/build/testrun/regress/regress/regression.diffs

+ERROR:  relation "t" already exists
I made the same mistake, regress test using a simple name like "t" will conflict
with other regress tests.

please check the attached, mainly regress tests changes.

Вложения

Re: create table like including storage parameter

От
Nathan Bossart
Дата:
On Sun, Sep 28, 2025 at 08:28:45PM -0500, David G. Johnston 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-storage ones we’d include those as
> well, so qualifying with a parameter type doesn’t seem correct.

+1

-- 
nathan



Re: create table like including storage parameter

От
jian he
Дата:
On Sat, Oct 25, 2025 at 1:48 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> On Sun, Sep 28, 2025 at 08:28:45PM -0500, David G. Johnston 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-storage ones we’d include those as
> > well, so qualifying with a parameter type doesn’t seem correct.
>
> +1
>
> --
> nathan

hi.

attached patch using syntax:
CREATE TABLE LIKE INCLUDING PARAMETERS.

Вложения