Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: Function_error_message.patch
Description: text/x-diff (477 bytes)

Responses

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group