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

From Balazs Klein
Subject BUG #5108: plpgsql function name conflict with table alias
Date
Msg-id 200910120754.n9C7sGj6063983@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5108: plpgsql function name conflict with table alias
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5108
Logged by:          Balazs Klein
Email address:      Balazs.Klein@gmail.com
PostgreSQL version: 8.4.1
Operating system:   Windows XP
Description:        plpgsql function name conflict with table alias
Details:

I have a plpgsql function called
irq(IN ulist integer[], .....)

defined as

Select ..........
irq.instreq_min_metcount,
irq.ref_deptype,
irq.instreq_aggrfunc
From .................. instrument_requirement irq ON ........


It works fine on 8.1 Linux

On 8.4.1 on windows XP running the function gives an error message
(Undefined column: 7 ERROR: record "rec" has no field "instreq_id") wich is
strange because the underlying query does return that column.
I run the create script of irq to create irq2 - and irq2 works fine.
I delete irq and rename irq2 to irq and I get the error back.

The error is consistent in the sense that if I delete the database and
restore it it appears again the same way.

I replace the table alias irq to instreq and the function works.

I believe it is a conflict between the table alias and the function name.

I raised the issue and got help on the mail list:
http://www.nabble.com/strange-plpgsql-error-td25847709.html#a25848066

Thanks and regards.
Balazs

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Next
From: Tom Lane
Date:
Subject: Re: BUG #5108: plpgsql function name conflict with table alias