Re: [GENERAL] PL/pgSQL and SETOF

2007-12-03 Thread Merlin Moncure
On Dec 3, 2007 3:31 PM, Pavel Stehule <[EMAIL PROTECTED]> wrote: > > > no. Your simplest version is historic relict and is available only in > > > sql language. I am not sure, maybe in C language too. > > > > It is extremely useful to be able call functions in this way. I > > really wish it were p

Re: [GENERAL] PL/pgSQL and SETOF

2007-12-03 Thread Pavel Stehule
Hello > > > > no. Your simplest version is historic relict and is available only in > > sql language. I am not sure, maybe in C language too. > > It is extremely useful to be able call functions in this way. I > really wish it were possible to do this with pl/sql functions as > well... > > merlin

Re: [GENERAL] PL/pgSQL and SETOF

2007-12-03 Thread Merlin Moncure
On Nov 30, 2007 1:18 PM, Pavel Stehule <[EMAIL PROTECTED]> wrote: > On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > But still on that subject: is my version of get_items2 the simplest > > that is possible in PL/pgSQL? It seems awfully verbose compared to > > the SQL version... >

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Pavel Stehule
On 30/11/2007, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Pavel Stehule escribió: > > On 30/11/2007, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > > > Pavel Stehule escribió: > > > > On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > > > > > > > But still on that subject: is my vers

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Alvaro Herrera
Pavel Stehule escribió: > On 30/11/2007, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > > Pavel Stehule escribió: > > > On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > > > > > But still on that subject: is my version of get_items2 the simplest > > > > that is possible in PL/pgSQL?

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Pavel Stehule
On 30/11/2007, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > Pavel Stehule escribió: > > On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > > > But still on that subject: is my version of get_items2 the simplest > > > that is possible in PL/pgSQL? It seems awfully verbose compared to

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Alvaro Herrera
Pavel Stehule escribió: > On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > But still on that subject: is my version of get_items2 the simplest > > that is possible in PL/pgSQL? It seems awfully verbose compared to > > the SQL version... > > no. Your simplest version is histori

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Pavel Stehule
On 30/11/2007, Cultural Sublimation <[EMAIL PROTECTED]> wrote: > > I would guess you're calling it like: > > > > SELECT get_items2(); > > > > whereas, you should call set returning functions like: > > > > SELECT * FROM get_items2(); > > Hi, > > Yeah, that was the problem -- thanks! > > But stil

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Cultural Sublimation
> I would guess you're calling it like: > > SELECT get_items2(); > > whereas, you should call set returning functions like: > > SELECT * FROM get_items2(); Hi, Yeah, that was the problem -- thanks! But still on that subject: is my version of get_items2 the simplest that is possible in PL/

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Pavel Stehule
Hello > Unfortunately it doesn't work! Postgresql complains that "set-valued > function called in context that cannot accept a set". Anyway, what am > I doing wrong, and what is the simplest way of translating get_items > in PL/pgSQL? > > Thanks in advance! > C.S. try select * from get_items2

Re: [GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Sam Mason
On Fri, Nov 30, 2007 at 09:09:28AM -0800, Cultural Sublimation wrote: > Postgresql complains that "set-valued > function called in context that cannot accept a set". Anyway, what am > I doing wrong, and what is the simplest way of translating get_items > in PL/pgSQL? I would guess you're calling

[GENERAL] PL/pgSQL and SETOF

2007-11-30 Thread Cultural Sublimation
Hi, I am having trouble getting a really simple PL/pgSQL function to work. I am beginning to wonder if there is not a bug somewhere, or if Postgresql's type system is not broken. Anyway, suppose I have the following table and type defined: CREATE TABLE items (