title: PostgreSQL-13: Partitioning with overlapping ranges
body: <p>I have a blacklist with certain strings beginning with the character '0','1','2',...,'9','a','b','c','d','e','f','?'.</p>
  <p>Then I create the following table:</p>
  <pre><code>CREATE TABLE blacklist (concat TEXT UNIQUE NOT NULL) PARTITION BY RANGE (concat);
  </code></pre>
  <p>Now I do RANGE partitioning:</p>
  <pre><code>CREATE TABLE IF NOT EXISTS blacklist_list_0 PARTITION OF blacklist FOR VALUES FROM ('0') TO ('0ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_0 ADD CONSTRAINT blacklist_list_0 CHECK (concat &gt;= '0' AND concat &lt;= '0ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_1 PARTITION OF blacklist FOR VALUES FROM ('1') TO ('1ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_1 ADD CONSTRAINT blacklist_list_1 CHECK (concat &gt;= '1' AND concat &lt;= '1ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_2 PARTITION OF blacklist FOR VALUES FROM ('2') TO ('2ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_2 ADD CONSTRAINT blacklist_list_2 CHECK (concat &gt;= '2' AND concat &lt;= '2ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_3 PARTITION OF blacklist FOR VALUES FROM ('3') TO ('3ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_3 ADD CONSTRAINT blacklist_list_3 CHECK (concat &gt;= '3' AND concat &lt;= '3ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_4 PARTITION OF blacklist FOR VALUES FROM ('4') TO ('4ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_4 ADD CONSTRAINT blacklist_list_4 CHECK (concat &gt;= '4' AND concat &lt;= '4ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_5 PARTITION OF blacklist FOR VALUES FROM ('5') TO ('5ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_5 ADD CONSTRAINT blacklist_list_5 CHECK (concat &gt;= '5' AND concat &lt;= '5ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_6 PARTITION OF blacklist FOR VALUES FROM ('6') TO ('6ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_6 ADD CONSTRAINT blacklist_list_6 CHECK (concat &gt;= '6' AND concat &lt;= '6ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_7 PARTITION OF blacklist FOR VALUES FROM ('7') TO ('7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_7 ADD CONSTRAINT blacklist_list_7 CHECK (concat &gt;= '7' AND concat &lt;= '7ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_8 PARTITION OF blacklist FOR VALUES FROM ('8') TO ('8ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_8 ADD CONSTRAINT blacklist_list_8 CHECK (concat &gt;= '8' AND concat &lt;= '8ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_9 PARTITION OF blacklist FOR VALUES FROM ('9') TO ('9ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_9 ADD CONSTRAINT blacklist_list_9 CHECK (concat &gt;= '9' AND concat &lt;= '9ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_a PARTITION OF blacklist FOR VALUES FROM ('a') TO ('affffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_a ADD CONSTRAINT blacklist_list_a CHECK (concat &gt;= 'a' AND concat &lt;= 'affffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_b PARTITION OF blacklist FOR VALUES FROM ('b') TO ('bffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_b ADD CONSTRAINT blacklist_list_b CHECK (concat &gt;= 'b' AND concat &lt;= 'bffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_c PARTITION OF blacklist FOR VALUES FROM ('c') TO ('cffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_c ADD CONSTRAINT blacklist_list_c CHECK (concat &gt;= 'c' AND concat &lt;= 'cffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_d PARTITION OF blacklist FOR VALUES FROM ('d') TO ('dffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_d ADD CONSTRAINT blacklist_list_d CHECK (concat &gt;= 'd' AND concat &lt;= 'dffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_e PARTITION OF blacklist FOR VALUES FROM ('e') TO ('effffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_e ADD CONSTRAINT blacklist_list_e CHECK (concat &gt;= 'e' AND concat &lt;= 'effffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_f PARTITION OF blacklist FOR VALUES FROM ('f') TO ('fffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  ALTER TABLE blacklist_list_f ADD CONSTRAINT blacklist_list_f CHECK (concat &gt;= 'f' AND concat &lt;= 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  CREATE TABLE IF NOT EXISTS blacklist_list_rest PARTITION OF blacklist FOR VALUES FROM ('?') TO ('?ffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
  ALTER TABLE blacklist_list_rest ADD CONSTRAINT blacklist_list_rest CHECK (concat &gt;= '?' AND concat &lt;= '?ffffffffffffffffffffffffffffffffffffffffffffffffffffffff' );
  </code></pre>
  <p>I get on Ubuntu 20.04 with postgres 13.1 the following error message:</p>
  <pre><code>postgres=# CREATE TABLE IF NOT EXISTS blacklist_list_rest PARTITION OF blacklist FOR VALUES FROM ('?') TO ('?ffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
  ERROR:  partition &quot;blacklist_list_rest&quot; would overlap partition &quot;blacklist_list_0&quot;
  </code></pre>
  <p>But I have no problem when I run this on my developer station (gentoo linux, postgres 13.1).</p>
  <p>Has someone an idea how to fix this? I don't think these characters overlap and I don't think I missed something like regular expressions ('?' should be detected as a character in this scenario).</p>