select unnest(), unnest() - Mailing list pgsql-sql

From Jasmin Dizdarevic
Subject select unnest(), unnest()
Date
Msg-id CAOveQuP6xqLzopbp+pMp8sbbSvKwHj2z6BXM_jEq9onqXwo+uQ@mail.gmail.com
Whole thread Raw
Responses Re: select unnest(), unnest()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
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

pgsql-sql by date:

Previous
From: abctevez
Date:
Subject: when transaction is committed in postgres
Next
From: Tom Lane
Date:
Subject: Re: select unnest(), unnest()