Re: [PATCHES] SQL: table function support

2008-06-12 Thread daveg
On Thu, Jun 12, 2008 at 12:33:57PM -0400, Tom Lane wrote: > David Fetter <[EMAIL PROTECTED]> writes: > > On Mon, Jun 09, 2008 at 05:56:59PM -0700, Neil Conway wrote: > >> I'm not necessarily opposed to this, but I wonder if we really need > >> *more* syntax variants for declaring set-returning func

Re: [PATCHES] SQL: table function support

2008-06-12 Thread Joshua D. Drake
On Thu, 2008-06-12 at 12:05 -0700, David Fetter wrote: > On Thu, Jun 12, 2008 at 12:33:57PM -0400, Tom Lane wrote: > > David Fetter <[EMAIL PROTECTED]> writes: > > > On Mon, Jun 09, 2008 at 05:56:59PM -0700, Neil Conway wrote: > I went and got reports from the field. Over the years, I've had to

Re: [PATCHES] SQL: table function support

2008-06-12 Thread David Fetter
On Thu, Jun 12, 2008 at 12:33:57PM -0400, Tom Lane wrote: > David Fetter <[EMAIL PROTECTED]> writes: > > On Mon, Jun 09, 2008 at 05:56:59PM -0700, Neil Conway wrote: > >> I'm not necessarily opposed to this, but I wonder if we really > >> need *more* syntax variants for declaring set-returning > >>

Re: [PATCHES] SQL: table function support

2008-06-12 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > On Mon, Jun 09, 2008 at 05:56:59PM -0700, Neil Conway wrote: >> I'm not necessarily opposed to this, but I wonder if we really need >> *more* syntax variants for declaring set-returning functions. The >> existing patchwork of features is confusing enough a

Re: [PATCHES] SQL: table function support

2008-06-12 Thread David Fetter
On Mon, Jun 09, 2008 at 05:56:59PM -0700, Neil Conway wrote: > On Tue, 2008-06-03 at 13:03 +0200, Pavel Stehule wrote: > > this patch add support of table functions syntax like ANSI SQL > > 2003. > > I'm not necessarily opposed to this, but I wonder if we really need > *more* syntax variants for d

Re: [PATCHES] SQL: table function support

2008-06-10 Thread Alvaro Herrera
Tom Lane escribió: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Tom Lane escribi�: > >> (It's also worth asking where the import is coming from. Who implements > >> the spec syntax anyway? DB2 maybe, but when was the last time we heard > >> from anyone trying to migrate from DB2 to PG?) > >

Re: [PATCHES] SQL: table function support

2008-06-10 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > what is more logical and consistent? They're both utterly arbitrary, but the "setof" syntax has been in Postgres since forever, and applies to more things than just "record". The other one doesn't fit in with anything else --- it's just a syntactic war

Re: [PATCHES] SQL: table function support

2008-06-10 Thread Pavel Stehule
2008/6/10 Neil Conway <[EMAIL PROTECTED]>: > On Tue, 2008-06-10 at 06:42 +0200, Pavel Stehule wrote: >> internally is table functions implemenation identical with SRF. > > It's not the internals that I'm concerned about. > >> Semantically is far - user's doesn't specify return type (what is from >>

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Neil Conway
On Tue, 2008-06-10 at 06:42 +0200, Pavel Stehule wrote: > internally is table functions implemenation identical with SRF. It's not the internals that I'm concerned about. > Semantically is far - user's doesn't specify return type (what is from > PostgreSQL), but specifies return table, what is mo

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Pavel Stehule
2008/6/10 Neil Conway <[EMAIL PROTECTED]>: > On Tue, 2008-06-03 at 13:03 +0200, Pavel Stehule wrote: >> this patch add support of table functions syntax like ANSI SQL 2003. > > I'm not necessarily opposed to this, but I wonder if we really need > *more* syntax variants for declaring set-returning f

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Pavel Stehule
2008/6/10 Tom Lane <[EMAIL PROTECTED]>: > Neil Conway <[EMAIL PROTECTED]> writes: >> On Tue, 2008-06-03 at 13:03 +0200, Pavel Stehule wrote: >>> this patch add support of table functions syntax like ANSI SQL 2003. > >> I'm not necessarily opposed to this, but I wonder if we really need >> *more* sy

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > Tom Lane escribió: >> (It's also worth asking where the import is coming from. Who implements >> the spec syntax anyway? DB2 maybe, but when was the last time we heard >> from anyone trying to migrate from DB2 to PG?) > Sourceforge? They gave up on u

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Alvaro Herrera
Tom Lane escribió: > (It's also worth asking where the import is coming from. Who implements > the spec syntax anyway? DB2 maybe, but when was the last time we heard > from anyone trying to migrate from DB2 to PG?) Sourceforge? -- Alvaro Herrerahttp://www.Comma

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes: > On Tue, 2008-06-03 at 13:03 +0200, Pavel Stehule wrote: >> this patch add support of table functions syntax like ANSI SQL 2003. > I'm not necessarily opposed to this, but I wonder if we really need > *more* syntax variants for declaring set-returning funct

Re: [PATCHES] SQL: table function support

2008-06-09 Thread Neil Conway
On Tue, 2008-06-03 at 13:03 +0200, Pavel Stehule wrote: > this patch add support of table functions syntax like ANSI SQL 2003. I'm not necessarily opposed to this, but I wonder if we really need *more* syntax variants for declaring set-returning functions. The existing patchwork of features is con

[PATCHES] SQL: table function support

2008-06-03 Thread Pavel Stehule
Hello this patch add support of table functions syntax like ANSI SQL 2003. CREATE OR REPLACE FUNCTION foo_sql(integer) RETURNS TABLE(a integer, b integer, c integer) AS $$ SELECT i, i+1, i+2 FROM generate_series(1, $1) g(i); $$ LANGUAGE sql; CREATE OR REPLACE FUNCTION foo_plpgsql1(m integ