Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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: Wed, 28 Sep 2005 17:07:40 -0500
  • Message-id: <433B142C(dot)8070707(at)amsoftwaredesign(dot)com>

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






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group