Re: Found small issue with OUT params

Поиск
Список
Период
Сортировка
От Tony Caduto
Тема Re: Found small issue with OUT params
Дата
Msg-id 433B142C.8070707@amsoftwaredesign.com
обсуждение исходный текст
Ответ на Re: Found small issue with OUT params  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Found small issue with OUT params  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:

>Tony Caduto <tony_caduto@amsoftwaredesign.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





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: execution of prepared statements leaks memory
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: enhanced pgbench