Re: [GENERAL] Curious unnest behavior

2013-01-04 Thread Pavel Stehule
Hello 2013/1/3 Jeff Trout thres...@real.jefftrout.com: I just ran into an interesting thing with unnest and empty arrays. create table x ( a int, b int[] ); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}');

[GENERAL] Curious unnest behavior

2013-01-03 Thread Jeff Trout
I just ran into an interesting thing with unnest and empty arrays. create table x ( a int, b int[] ); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}'); insert into x(a,b) values (1, '{}'); select a, b from x; select a, unnest(b) from x; insert into

Re: [GENERAL] Curious unnest behavior

2013-01-03 Thread Patrick Krecker
I have to say, this seems straightforward to me. An array with N elements gets N rows in the result set. I'm curious what other behavior would be more reasonable. On Thu, Jan 3, 2013 at 11:22 AM, Jeff Trout thres...@real.jefftrout.comwrote: I just ran into an interesting thing with unnest