PATCH: Improve DROP FUNCTION hint

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PATCH: Improve DROP FUNCTION hint
Date: 2012-06-09 15:42:26
Message-ID: CAEZATCWFx2Z8j=-MfT3M=WMkiayyWZA+yKzbP0Ld2tGyVW8GsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is a small patch to improve the HINT message produced by
CREATE OR REPLACE FUNCTION when the new function definition conflicts
with the old definition. With this patch the hint now includes the
function's name and signature as a directly pasteable SQL command. So,
for example, instead of

psql:functions.sql:70: ERROR: cannot change return type of existing function
HINT: Use DROP FUNCTION first.

it now says

psql:functions.sql:70: ERROR: cannot change return type of existing function
HINT: Use DROP FUNCTION foo(integer,integer) first.

which saves having to open the file, find the function and then type
in the DROP statement manually.

Regards,
Dean

Attachment Content-Type Size
drop-fn-hint.patch application/octet-stream 7.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-06-09 15:46:18 Re: [COMMITTERS] pgsql: Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented
Previous Message Simon Riggs 2012-06-09 15:36:38 pgsql: Add ERROR msg for GLOBAL/LOCAL TEMP is not yet implemented