Re: pl/python out params

From: Richard Albright <ralbright(at)insiderscore(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: pl/python out params
Date: 2010-08-07 19:07:42
Message-ID: 4C5DAEFE.50106@insiderscore.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

first define a custom type, then drop the out parameters.

create type mytype as (
i integer,
j text );

create or replace function outtest()
returns mytype as
$BODY$
i = 1
j = 'something'
return ( i, j )
$BODY$
language plpythonu;

select * from outtest();
i | j
---+-----------
1 | something
(1 row)

On 08/07/2010 10:49 AM, Imre Horvath wrote:
> Hi!
>
> Is there a way to use output parameters with a pl/python fucntion?
> I've tried with no luck: if I define out parameters, it says return type
> must be record, if I define a record return type, I get an error on
> executing that pl/python doesn't support record return type...
>
> My simple test func is:
>
> create or replace function outtest(out i integer, out j text)
> returns boolean as
> $BODY$
> i = 1
> j = 'something'
> return True
> $BODY$
> language plpythonu;
>
> Thanks in advance:
> Imre Horvath
>
>
>

--
*Rick Albright*
Senior Quantitave Analyst
Web: www.insiderscore.com <https://www.insiderscore.com/>
Email: ralbright(at)insiderscore(dot)com <mailto:ralbright(at)insiderscore(dot)com>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-08-07 20:22:30 Re: pl/python out params
Previous Message Imre Horvath 2010-08-07 14:49:46 pl/python out params