pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Albright <ralbright@insiderscore.com>
To: pgsql-sql@postgresql.org
Subject: Re: pl/python out params
Date: Sat, 07 Aug 2010 15:07:42 -0400
Message-ID: <4C5DAEFE.50106@insiderscore.com> (raw)
In-Reply-To: <1281192586.5038.3.camel@cytherian.blemidon.dyndns.org>
References: <1281192586.5038.3.camel@cytherian.blemidon.dyndns.org>

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@insiderscore.com <mailto:ralbright@insiderscore.com>

view thread (3+ messages)  latest in thread

Message-ID: <4C5DAEFE.50106@insiderscore.com>
Permalink:  ../4C5DAEFE.50106@insiderscore.com/
Also on:    postgresql.org/message-id/4C5DAEFE.50106@insiderscore.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ralbright@insiderscore.com
  Subject: Re: pl/python out params
  In-Reply-To: <4C5DAEFE.50106@insiderscore.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox