Re: [HACKERS] proposal: array utility functions phase 1

2002-12-11 Thread Joe Conway
Tom Lane wrote: It seems like somehow we need a level of FROM/WHERE producing some base rows, and then a set of table function calls to apply to each of the base rows, and then another level of WHERE to filter the results of the function calls (in particular to provide join conditions to identify

Re: [HACKERS] proposal: array utility functions phase 1

2002-12-09 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: Yes, this is exactly what I was yearning to do. Was there a spec or technical reason (or both) for not allowing the following? select * from array_values(g.grolist), pg_group g where g.groname = 'g2'; This seems fairly unworkable to me as-is. By

Re: [HACKERS] proposal: array utility functions phase 1

2002-12-09 Thread Joe Conway
Tom Lane wrote: This seems fairly unworkable to me as-is. By definition, WHERE selects from a cross-product of the FROM tables; to make the above do what you want, you'd have to break that fundamental semantics. The semantics of explicit JOIN cases would be broken too. What we need is some

[HACKERS] proposal: array utility functions phase 1

2002-12-08 Thread Joe Conway
I'm working on the TODO item Allow easy display of usernames in a group in the context of a slightly larger effort to improve usability of arrays. I'm far enough down the road to have a better idea of where I want to go with this, but I'd like to vet those ideas with the list so I don't waste

Re: [HACKERS] proposal: array utility functions phase 1

2002-12-08 Thread Tom Lane
Joe Conway [EMAIL PROTECTED] writes: [ much snipped ] The first function borrows from an idea Nigel Andrews had -- i.e. expand an array into rows (and possibly columns). It currently works like this: -- 1D array test=# select * from array_values('{101,102,103,104}'::int[]) as (a int, b1