Re: plpgsql out parameter with select into

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Horváth Imre <horvath(dot)imre(at)blemidon(dot)hu>, pgsql-sql(at)postgresql(dot)org
Subject: Re: plpgsql out parameter with select into
Date: 2010-08-18 22:18:11
Message-ID: AANLkTikfAFF1amAWeYs0MsGduoE1EDcuc2r078XsDTNj@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

2010/8/19 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> 2010/8/18 Horváth Imre <horvath(dot)imre(at)blemidon(dot)hu>:
>>> It don't work...
>
> A function returning a scalar type cannot control the column name
> assigned to the scalar in the calling query.  To do that, you need to
> return a composite type, which means there need to be at least two OUT
> parameters if you're trying to do it via OUT-parameter names.

So we could do either

SELECT funcname INTO varname FROM funcname()

or

SELECT * INTO varname FROM funcname();

or

SELECT funcname() INTO varname

correct?

>
>                        regards, tom lane
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray(dot)ru(at)gmail(dot)com / Skype: gray-hemp / ICQ: 29353802

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gordon McVey 2010-08-19 11:48:00 Extract created and last modified data
Previous Message Tom Lane 2010-08-18 22:09:58 Re: plpgsql out parameter with select into