Re: BUG #4585: out parameter name cuases disruption in custom aggregate?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "robert treat" <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4585: out parameter name cuases disruption in custom aggregate?
Date: 2008-12-16 22:22:02
Message-ID: 16570.1229466122@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"robert treat" <xzilla(at)users(dot)sourceforge(dot)net> writes:
> Apparently the assignment of the integer value is somehow dependent on the
> name of the out parameter; when it matches the column name, you get nulls
> back. Is this a bug?

No, it's expected behavior. You're "accumulating" n copies of the
current value of the parameter variable, which is null because you've
not yet assigned anything to it.

The real issue here is that an unqualified name is matched against
plpgsql variables before considering names coming from the SQL query.
See previous pghackers discussions about changing that, and the massive
breakage of user code that would doubtless ensue :-(

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2008-12-17 00:55:31 Re: BUG #4582: Renaming sequences and default value
Previous Message Robert Treat 2008-12-16 21:17:04 Re: BUG #4585: out parameter name cuases disruption in custom aggregate?