Search Postgresql Archives

variable name in plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems that one cannot use the variable name that is the same as the
column name of a relation like in the following function

------
create or replace function bla() returns void language plpgsql as $$
declare
	email varchar;
begin
	select email into email from pass where id=1;
	raise notice 'pass is %',email;
end;
$$
------
I get null value email and postgres 8.4.4 does not warn nor raise
error on creating;
I know for a fact that email must not be null; it's not null when I
rename the variable
email to something else.

As far as I can see this isn't documented anywhere.  Is this because
it's common/insider knowledge?  Can someone confirm?

Thanks

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux