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

From Tender Wang
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CAHewXNmBM+5qbrJMu60NxPn+0y-=2wXM-QVVs3xRp8NxFvDb9A@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
 Hi Alexander,

I found this feature merged; thanks for this work.
I tested it and found that one place in the error errcode may need to be changed.
In checkPartition():
...
if (get_partition_parent(partRelOid, false) != RelationGetRelid(rel))
    ereport(ERROR,
    errcode(ERRCODE_UNDEFINED_TABLE),
    errmsg("relation \"%s\" is not a partition of relation \"%s\"",
...

ERRCODE_UNDEFINED_TABLE usually means "table does not exist."
When entering here, the table should exist, otherwise table_open() already reports an error.
I found another two errcode in checkPartition() use ERRCODE_WRONG_OBJECT_TYPE,
In the attached patch, I replace ERRCODE_UNDEFINED_TABLE with ERRCODE_WRONG_OBJECT_TYPE.

--
Thanks,
Tender Wang
Attachment

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Fix typo 586/686 in atomics/arch-x86.h
Next
From: Xuneng Zhou
Date:
Subject: Re: RFC: adding pytest as a supported test framework