Re: Missing array support - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Missing array support
Date
Msg-id 3F00F2CC.50501@joeconway.com
Whole thread Raw
In response to Re: Missing array support  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
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





pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Missing array support
Next
From: elein
Date:
Subject: Re: [GENERAL] PlPython