Correcting Error message

From: Piyush Newe <piyush(dot)newe(at)enterprisedb(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Correcting Error message
Date: 2010-02-26 08:30:05
Message-ID: 3b3d33c91002260030q6ad98587xeed97a94f63013a0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Consider following testcase,

CREATE TABLE footable(id int4, name varchar2(10));

CREATE FUNCTION foofunc(a footable, b integer DEFAULT 10)
RETURNS integer AS $$ SELECT 123; $$ LANGUAGE SQL;

CREATE FUNCTION foofunc(a footable, b numeric DEFAULT 10)
RETURNS integer AS $$ SELECT 123; $$ LANGUAGE SQL;

SELECT (footable.*).foofunc FROM footable;
ERROR: column footable.foofunc does not exist
LINE 1: SELECT (footable.*).foofunc FROM footable;
^

The error message thrown is seems to be wrong. When I dig into the code, I
found in function ParseFuncOrColumn(), if we just add small condition it
will throw correct error message. i.e. " function foofunc(footable) is not
unique". I have made a slight change in code, which is throwing the correct
error message now. The code changes are attached in the patch.

--
Piyush S Newe
Principal Engineer
EnterpriseDB
office: +91 20 3058 9500
www.enterprisedb.com

Website: www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the
individual or entity to whom it is addressed. This message contains
information from EnterpriseDB Corporation that may be privileged,
confidential, or exempt from disclosure under applicable law. If you are not
the intended recipient or authorized to receive this for the intended
recipient, any use, dissemination, distribution, retention, archiving, or
copying of this communication is strictly prohibited. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete this message.

Attachment Content-Type Size
Function_error_message.patch text/x-diff 477 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2010-02-26 08:33:35 Hot Standby query cancellation and Streaming Replication integration
Previous Message Mark Mielke 2010-02-26 08:13:31 Re: Avoiding bad prepared-statement plans.