Re: How to Declare Functions Containing OUT PArameters?

From: Bill Thoen <bthoen(at)gisnet(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: jd(at)commandprompt(dot)com, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to Declare Functions Containing OUT PArameters?
Date: 2010-07-14 20:19:25
Message-ID: 4C3E1BCD.1070604@gisnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks guys. I think I see now. I was thinking it was a more transparent
pass-by-value / pass-by-reference thing.
Anyway I solved my problem by going back into my comfort zone and
explicitly return a record and I'm not using OUT parameters. They're
aren't what I thought they were and I'm working on a tight schedule, so
I don't have much toim m eto explre. The compiler seems happier without
them, and when it's happy, I'm happy.

Tom Lane wrote:
> "Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
>
>> On Wed, 2010-07-14 at 12:21 -0600, Bill Thoen wrote:
>>
>>> I'm having some difficulty getting plpgsql to recognize a function with
>>> a couple of OUT parameters.
>>>
>
>
>>> psql:ex_out_fail.sql:28: ERROR: function fishy(text, text, integer,
>>> real) does not exist
>>>
>
>
>> You are passing four IN paramaters. The out paramaters are used in
>> return are they not?
>>
>
> You'd need to do something like
>
> SELECT * INTO num, fnum FROM fishy(str1, str2) ;
>
> OUT parameters in PG are just syntactic sugar for defining a
> record-returning function. The call syntax still works as if you'd
> written CREATE FUNCTION foo (IN-parameters-only) RETURNS some-record-type.
>
> regards, tom lane
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anthony Presley 2010-07-14 20:30:20 Re: Index on a Decrypt / Bytea2Text Function
Previous Message Tom Lane 2010-07-14 19:56:40 Re: Index on a Decrypt / Bytea2Text Function