Hi, we have some queries that use unnest() function.
create table configuration (
id int,
advisor text,
branch text,
primary key(id)
);
insert into configuration values
(1,'a','00,01'),
(2,'a','00'),
(3,'b','02,03'),
(4,'c','05'),
(5,'d,e','00,01');
select id, unnest(string_to_array(advisor,',')), unnest(string_to_array(branch,','))
from configuration;
PG9.6:
id | unnest | unnest
----+--------+--------
1 | a | 00
1 | a | 01
2 | a | 00
3 | b | 02
3 | b | 03
4 | c | 05
5 | d | 00
5 | e | 01
PG10:
id | unnest | unnest
----+--------+--------
1 | a | 00
1 | | 01
2 | a | 00
3 | b | 02
3 | | 03
4 | c | 05
5 | d | 00
5 | e | 01
- Is this wanted in PG10 or a bug?
- Is there a way to change the behaviour of pgsql to produce output like 9.6?
- A smooth sql-workaround?
Thank you very much!
Regards, Jasmin