Re: Found small issue with OUT params

From: Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Found small issue with OUT params
Date: 2005-09-28 22:07:40
Message-ID: 433B142C.8070707@amsoftwaredesign.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> writes:
>
>
>>If I call it like this:
>>select * from FIND_USER_SOCKET_BYNAME('juser');
>>I would expect to get back 1 value with the name of the OUT param
>>(OUT_SOCKET_ADDRESS).
>>However it comes back with the name of the function
>>
>>
>
>This is intentional, for compatibility with the pre-existing behavior
>with functions in FROM. A function that isn't returning a record is
>effectively declared as
> FROM foo(...) AS foo(foo)
>while a function that does return a record type gives you
> FROM foo(...) AS foo(col1, col2)
>
> regards, tom lane
>
>
>
Tom,
Please don't take this the wrong way, but don't you think even if a
single param is declared as OUT it should return the name of the OUT param?

If the function has no OUT params and uses the return keyword it should
return the name of the function, if it has one or many out params it
should return even a single column as the name of the OUT param.

It seems inconsistant that just because I have one OUT param declared it
does not return the name I specified for that param.

Isn't it possible to detect that the function has a single OUT param
declared and if a OUT param is declared return that name?

I am bringing this up because people coming over from Oracle or MS SQL
server will notice something like this.

Thanks,

Tony Caduto

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2005-09-28 22:59:03 Re: enhanced pgbench
Previous Message Tom Lane 2005-09-28 22:07:28 Re: execution of prepared statements leaks memory