case dumbiness in return from functions

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: case dumbiness in return from functions
Date: 2008-01-17 23:54:19
Message-ID: 20080118005419.63ab5321@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

After discovering that pg_get_serial_sequence behaves in a bit
strange way[1] when it deals to case sensitiveness... I just
discovered that you've the same behaviour for any function... at
least in PHP.

postgresql
Versione: 8.1.11
php:
Versione: 5.2.0

eg.

create or replace function testA(out pIpPo int) as
$$
begin
pIpPo:=7;
return;
end;
$$ language plpgsql;

...

$result=pg_query('select pIpPo from testA()');
$row=pg_fetch_array($result);
print(var_export($row));

array ( 'pippo' => '7', )

that makes
$ImSoSad=$row['pIpPo'];
return null

And 2h went trying to understand where a session went lost :(

Fortunately it can be fixed at a small price with an alias... but
still I find it a pain.
Whan you've identifiers composed of more than 2 words, camel case can
make your code lines much shorter.

Please, please, please... fix this. Minor things like this can make
coding in Postgres MUCH more enjoyable.

[1] this is documented... is this awwwww bwaaaa bwaaaaaa behaviour of
functions documented as well?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-01-18 00:07:59 Re: case dumbiness in return from functions
Previous Message Mischa Sandberg 2008-01-17 23:52:33 Re: [ADMIN] postgresql in FreeBSD jails: proposal