Re: parameters in functions and overlap with names of columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: parameters in functions and overlap with names of columns
Date: 2009-08-04 15:00:23
Message-ID: 23231.1249398023@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it> writes:
> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> yes - the most common is an using of prefix '_' for local plpgsql
>> variables. Other possibility is using qualified names.

> Just to be sure... by qualified names you mean schema qualified name
> or table qualified names in case of columns... right...

Right. The plpgsql parser is (just barely) smart enough to not try
to substitute a local variable name for the second part of a qualified
name "a.b". So you could write "tab.col1" in your queries.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2009-08-04 15:02:28 Re: character 0xe29986 of encoding "UTF8" has no equivalent in "LATIN2"
Previous Message Pavel Stehule 2009-08-04 14:59:51 Re: parameters in functions and overlap with names of columns