Fix improper NULL handling in list partitioning code.

The previous logic was wrong when the value was NULL but there was
no partition for NULL.

Amit Langote, reviewed by Jeevan Ladhe

Discussion: http://postgr.es/m/d64f8498-70eb-3c88-b56d-c54fd3b0500f@lab.ntt.co.jp
This commit is contained in:
Robert Haas
2017-03-27 10:51:46 -04:00
parent 8355a011a0
commit 7ecb714358
3 changed files with 20 additions and 3 deletions

View File

@ -226,6 +226,12 @@ insert into mlparted values (1, 2);
-- selected by tuple-routing
insert into mlparted1 (a, b) values (2, 3);
-- check routing error through a list partitioned table when the key is null
create table lparted_nonullpart (a int, b char) partition by list (b);
create table lparted_nonullpart_a partition of lparted_nonullpart for values in ('a');
insert into lparted_nonullpart values (1);
drop table lparted_nonullpart;
-- check that RETURNING works correctly with tuple-routing
alter table mlparted drop constraint check_b;
create table mlparted12 partition of mlparted1 for values from (5) to (10);