Re: BUG #5108: plpgsql function name conflict with table alias - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5108: plpgsql function name conflict with table alias
Date
Msg-id 15732.1255395891@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5108: plpgsql function name conflict with table alias  (Balazs Klein <balazs.klein@gmail.com>)
Responses Re: BUG #5108: plpgsql function name conflict with table alias
List pgsql-bugs
Balazs Klein <balazs.klein@gmail.com> writes:
> CREATE OR REPLACE FUNCTION instreq(OUT instreq_id integer)
> ...
> Select instreq.instreq_id From aaa instreq

The problem that you've got here is that instreq.instreq_id is in fact
a qualified reference to the function's OUT parameter.  We didn't
support qualification of function parameter names in 8.1, but we do now.

In general, I'd say that this is bad coding style.  Not only do you have
an ambiguous use of "instreq_id" (is it a column reference or a
parameter reference?), but the name "instreq" *also* has multiple
possible referents in this function.  You'll save yourself a lot of
headaches if you avoid that sort of thing.

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Turner, Ian"
Date:
Subject: Kerberos authentication, Active Directory, and PostgreSQL
Next
From: Heikki Linnakangas
Date:
Subject: Re: Kerberos authentication, Active Directory, and PostgreSQL