Re: Add SPLIT PARTITION/MERGE PARTITIONS commands - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAPpHfdudazH3uQimTv=4ztU4M9j04CeQAcPZMVSbD-dYwuh=6w@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers
On Sun, Dec 21, 2025 at 9:42 AM Kirill Reshke <reshkekirill@gmail.com> wrote:
> On Sun, 21 Dec 2025, 12:14 Tender Wang, <tndrwang@gmail.com> wrote:
>> Alexander Korotkov <aekorotkov@gmail.com> 于2025年12月20日周六 19:08写道:
>>> I agree with you that ERRCODE_UNDEFINED_TABLE is certainly wrong error
>>> code because the table actually exists.  ERRCODE_WRONG_OBJECT_TYPE is
>>> better.  For example, we throw it when trying to attach a partition to
>>> non-partitioned table.  So, the parent table type is wrong.  However,
>>> are objects in the situation under consideration really have wrong
>>> type?  The problem is that one table is not partition of another.
>>> However, it's possibly that they could be attached without changing of
>>> their types.  So, I think about
>>> ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE.  What do you think?
>>
>>
>> It's ok for me. Please check the v2 patch.
>
>
> Hi! Your v2 looks fine
> The only question for me is, should we add any regression test to exercise this code, or it is not worth the
troubles?

I've checked contents of out regression tests.  I see we very rarely
include SQLSTATE there, mostly in psql and plpgsql tests.  Thus, I
think we should just fix the SQLSTATE without dedicating a test for
that.  So, I'm going to push the patch from Tender Wang if no
objections.

------
Regards,
Alexander Korotkov
Supabase



pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: SQL-level pg_datum_image_equal
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH v1] Fixed a spelling error in the comments in gininsert.c