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

From jian he
Subject Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
Date
Msg-id CACJufxET9Qe-=zJtjGrKPr7-1QbVcP9y-vJU9CMEDfPGt_dbyg@mail.gmail.com
Whole thread Raw
In response to Re: Add SPLIT PARTITION/MERGE PARTITIONS commands  (Dmitry Koval <d.koval@postgrespro.ru>)
Responses Re: Add SPLIT PARTITION/MERGE PARTITIONS commands
List pgsql-hackers
hi. about v59.

check_partitions_not_overlap_list
            overlap = list_intersection(sps1->bound->listdatums,
                                        sps2->bound->listdatums);
            if (list_length(overlap) > 0)
            {
                Const       *val = (Const *) lfirst(list_head(overlap));
                ereport(ERROR,
                        errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
                        errmsg("new partition \"%s\" would overlap
with another new partition \"%s\"",
                               sps1->name->relname, sps2->name->relname),
                        parser_errposition(pstate, exprLocation((Node *) val)));
            }

list_intersection seems not right, how can we be sure it deals with
collation correctly?

It failed to deal with numeric special value (0.0).
demo:
CREATE TABLE t (a numeric) PARTITION BY LIST (a);
CREATE TABLE t1 PARTITION OF t FOR VALUES in  ('0', '1');
ALTER TABLE t SPLIT PARTITION t1 INTO
  (PARTITION x  FOR VALUES in  ('0'),
  PARTITION x1 FOR VALUES IN ('0.0', '1'));

I’ll think about the solution later; for now, I just wanted to point
out this problem.



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Having postgresql.org link to cgit instead of gitweb
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: Having postgresql.org link to cgit instead of gitweb