| From: | Alexander Korotkov <aekorotkov(at)gmail(dot)com> |
|---|---|
| To: | Justin Pryzby <pryzby(at)telsasoft(dot)com> |
| Cc: | Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>, Dmitry Koval <d(dot)koval(at)postgrespro(dot)ru>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
| Subject: | Re: Add SPLIT PARTITION/MERGE PARTITIONS commands |
| Date: | 2026-06-21 12:11:26 |
| Message-ID: | CAPpHfduZ9Yd6vG0EOZUa_MOVxpEDMsZB-89pgNypwFzp2ax+NQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Jun 18, 2026 at 6:49 PM Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> On Thu, Jun 18, 2026 at 10:31:11AM +0300, Alexander Korotkov wrote:
> > Pushed with your suggestions accepted.
>
> Thanks. When I went back to test this, I merged ~25 partitions that
> were all on the same tablespace, but the merged table was created on the
> default tablespace.
>
> I tried again with default_tablespace set, but it was ignored. I think
> that's wrong. It's good to follow the tablespace of the parent table,
> but if it has no tablespace set, default_tablespace should be obeyed.
> See surrounding logic in DefineRelation.
>
> I see the docs say this:
> + <command>ALTER TABLE MERGE PARTITION</command> uses the partitioned
> + table itself as the template to construct the new partition.
> + The new partition will inherit the same table access method, persistence
> + type, and tablespace as the partitioned table.
Correct, please see the attached patch, it makes
createPartitionTable() deal with tablespaces the same was as
DefineRelation() does.
------
Regards,
Alexander Korotkov
Supabase
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Take-into-account-default_tablespace-during-MERGE.patch | application/octet-stream | 15.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | JoongHyuk Shin | 2026-06-21 09:27:42 | Re: [PATCH] Don't call ereport(ERROR) from recovery target GUC assign hooks |