You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this great extension!
I noticed that non-key index columns (using the INCLUDE keyword) are inherited as normal index columns.
A minimal example:
create table example_table (
id BIGINT not null,
some_other_column BIGINT not null,
insertTime TIMESTAMPTZ NOT NULL DEFAULT now()
) PARTITION BY RANGE (insertTime);
CREATE TABLE example_table_template (LIKE example_table);
ALTER TABLE public.example_table_template ADD PRIMARY KEY (id) INCLUDE (some_other_column);
SELECT partman.create_parent('public.example_table', 'inserttime', '1 month', p_template_table := 'public.example_table_template', p_premake := 2);
postgres=# \d example_table_template
Table "public.example_table_template"
Column | Type | Collation | Nullable | Default
-------------------+--------------------------+-----------+----------+---------
id | bigint | | not null |
some_other_column | bigint | | not null |
inserttime | timestamp with time zone | | not null |
Indexes:
"example_table_template_pkey" PRIMARY KEY, btree (id) INCLUDE (some_other_column) <-------
postgres=# \d example_table_p20240501
Table "public.example_table_p20240501"
Column | Type | Collation | Nullable | Default
-------------------+--------------------------+-----------+----------+---------
id | bigint | | not null |
some_other_column | bigint | | not null |
inserttime | timestamp with time zone | | not null | now()
Partition of: example_table FOR VALUES FROM ('2024-05-01 00:00:00+00') TO ('2024-06-01 00:00:00+00')
Indexes:
*example_table_p20240501_pkey" PRIMARY KEY, btree (id, some_other_column) <-------
I would have expected the index of example_table_p20240501 to be the same as the index on the example_table_template table. Not a huge issue but I thought you might want to know about it.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi team,
First of all, thank you for this great extension!
I noticed that non-key index columns (using the
INCLUDE
keyword) are inherited as normal index columns.A minimal example:
I would have expected the index of
example_table_p20240501
to be the same as the index on theexample_table_template
table. Not a huge issue but I thought you might want to know about it.Thanks!
The text was updated successfully, but these errors were encountered: