Re: Missing array support

From: Joe Conway <mail(at)joeconway(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Missing array support
Date: 2003-07-01 02:32:44
Message-ID: 3F00F2CC.50501@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut wrote:
>>>* Using an array as a table source using UNNEST, something like:
>>>
>>>select * from unnest(test.b);
>>>(Check the exact spec to be sure; clause 7.6.)
>>
>>select * from unnest(array['a','b']);
>>?column?
>>----------
>> a
>> b
>>
>>select * from unnest(array['a','b']) WITH ORDINALITY;
>> ?column? | ?column?
>>----------+----------
>> 1 | a
>> 2 | b
>
>>select * from unnest(array['a','b']) as t(f1, f2) WITH ORDINALITY;
>> f1 | f2
>>----+----
>> 1 | a
>> 2 | b
>
> The WITH ORDINALITY goes before the AS clause.
>
> The reason it is defined in terms of the LATERAL clause is that that
> allows you to refer to column aliases defined in FROM items to its left.
> This is the way variable arguments of function calls as table sources can
> be resolved. (At least this is my interpretation. I found some examples
> on the web a few months ago about this.)
>

If I can get this done *without* supporting LATERAL by the end of the
evening (i.e. just implement the examples), would it possibly be
accepted? Or should UNNEST wait until we get LATERAL?

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jon Jensen 2003-07-01 02:45:47 sslmode patch
Previous Message Joe Conway 2003-07-01 02:15:29 Re: Missing array support

Browse pgsql-patches by date

  From Date Subject
Next Message Jon Jensen 2003-07-01 02:45:47 sslmode patch
Previous Message Joe Conway 2003-07-01 02:15:29 Re: Missing array support