Re: BUG #8226: Inconsistent unnesting of arrays

From: Greg Stark <stark(at)mit(dot)edu>
To: ddebernardy(at)yahoo(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8226: Inconsistent unnesting of arrays
Date: 2013-06-12 10:09:39
Message-ID: CAM-w4HMyYbOLAZE74WNOxd_RhFoLFa6Vsx4Z-6AZ_fx1yhQdug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Jun 12, 2013 at 9:58 AM, <ddebernardy(at)yahoo(dot)com> wrote:
> denis=# select 1 as a, unnest('{2,3}'::int[]) as b, unnest('{4,5}'::int[])

set returning functions in the target list of the select don't behave
the way you're thinking. What you probably want to do is move the
unnest() to the FROM clause:

select 1 as a, b, c from unnest('{2,3}'::int[]) as b(b),
unnest('{4,5}'::int[]) as c(c)

--
greg

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Denis de Bernardy 2013-06-12 10:19:51 Re: BUG #8226: Inconsistent unnesting of arrays
Previous Message Greg Stark 2013-06-12 10:05:02 Re: BUG #8226: Inconsistent unnesting of arrays