Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-21 Thread Tom Lane
Dean Rasheed writes: > On 20 November 2013 22:46, Andrew Gierth wrote: > "Tom" == Tom Lane writes: >> Tom> 1. Reinsert HEAD's prohibition against directly combining WITH >> Tom> ORDINALITY with a coldeflist (with a better error message and a >> Tom> HINT suggesting that you can get what you want

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-21 Thread Dean Rasheed
On 20 November 2013 22:46, Andrew Gierth wrote: >> "Tom" == Tom Lane writes: > > Tom> 1. Reinsert HEAD's prohibition against directly combining WITH > Tom> ORDINALITY with a coldeflist (with a better error message and a > Tom> HINT suggesting that you can get what you want via the TABLE >

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> 1. Reinsert HEAD's prohibition against directly combining WITH Tom> ORDINALITY with a coldeflist (with a better error message and a Tom> HINT suggesting that you can get what you want via the TABLE Tom> syntax). That gets my vote. -- Andrew (irc:Rhodium

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread David Johnston
Tom Lane-2 wrote > David Johnston < > polobo@ > > writes: >> Just to clarify we are still allowing simple aliasing: > >> select * from generate_series(1,2) with ordinality as t(f1,f2); > > Right, that works (and is required by spec, I believe). It's what to > do with our column-definition-lis

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread Tom Lane
David Johnston writes: > Just to clarify we are still allowing simple aliasing: > select * from generate_series(1,2) with ordinality as t(f1,f2); Right, that works (and is required by spec, I believe). It's what to do with our column-definition-list extension that's at issue. > Not sure if th

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread David Johnston
Tom Lane-2 wrote > David Johnston < > polobo@ > > writes: >> Tom Lane-2 wrote >>> It seems to me that we don't really want this behavior of the coldeflist >>> not including the ordinality column. It's operating as designed, maybe, >>> but it's unexpected and confusing. We could either >>> >>>

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread Tom Lane
David Johnston writes: > Tom Lane-2 wrote >> It seems to me that we don't really want this behavior of the coldeflist >> not including the ordinality column. It's operating as designed, maybe, >> but it's unexpected and confusing. We could either >> >> 1. Reinsert HEAD's prohibition against dir

Re: [HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread David Johnston
Tom Lane-2 wrote > It seems to me that we don't really want this behavior of the coldeflist > not including the ordinality column. It's operating as designed, maybe, > but it's unexpected and confusing. We could either > > 1. Reinsert HEAD's prohibition against directly combining WITH ORDINALITY

[HACKERS] WITH ORDINALITY versus column definition lists

2013-11-20 Thread Tom Lane
Consider the following case of a function that requires a column definition list (example borrowed from the regression tests): create function array_to_set(anyarray) returns setof record as $$ select i AS "index", $1[i] AS "value" from generate_subscripts($1, 1) i $$ language sql strict immutabl