Thread

  1. Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

    Alexander Korotkov <aekorotkov@gmail.com> — 2025-12-21T22:02:22Z

    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