Re: set returning functions. - Mailing list pgsql-general

From Pavel Stehule
Subject Re: set returning functions.
Date
Msg-id 162867790709250729y2498a494pce31cbd49042ef95@mail.gmail.com
Whole thread Raw
In response to Re: set returning functions.  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Responses Re: set returning functions.  ("Merlin Moncure" <mmoncure@gmail.com>)
List pgsql-general
2007/9/25, Scott Marlowe <scott.marlowe@gmail.com>:
> On 9/24/07, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> > 2007/9/25, Rhys Stewart <rhys.stewart@gmail.com>:
> > > yes indeed. thats exactly it scott!!!
> > >
> > > On 9/24/07, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> > > > On 9/24/07, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> > > > > Hello Rhys
> > > > >
> > > > > its not mystery
> > > >
> > > > Yeah, but I think he wanted to be able to make his own function he
> > > > could call like:
> > > >
> > > > select myfunc(10);
> > > >
> >
> > Then you have to use sql language
> >
> > create or replace function mysrf(int)
> > returns setof integer as $$
> > select i from generate_series(1, $1) g(i);
> > $$ language sql;
>
> Do you HAVE to use sql plsql to get this to work?  I thought that all
> pl languages worked like this with pgsql.
>

if you can call SRF function in normal context (like SELECT srf()),
you have to use SQL language

Pavel

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: set returning functions.
Next
From: David Siebert
Date:
Subject: Porblems migrating a server.