Обсуждение: Fw: BUG #3695: Pgsql does not report non existing function

Поиск
Список
Период
Сортировка

Fw: BUG #3695: Pgsql does not report non existing function

От
"Roger Moloney"
Дата:
See below, clarification of bug report.

--------------------------------------------------
From: "Roger Moloney" <ramoloney@hotmail.com>
Sent: Friday, October 26, 2007 8:25 AM
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Subject: Re: [BUGS] BUG #3695: Pgsql does not report non existing function

> Hi Tom,
>
> Thanks for the reply but you have misunderstood my report.
>
> Yes, the function will be reported as not existing at run-time when the
> code is executed.
> This approach is easy and workable for small test programs.
>
> It is not workable for large projects which may have thousands of lines of
> ported code in pgsql.
> I would like to see the non-existing function reported (perhaps I need to
> put different log options on) at compile time.
> It is not possible for me to exercise all code paths to find functions
> that do not exist.
>
> Surely, the compiler must know or could produce a warning about
> non-existing functions at compile time.
>
> thanks again for the reply,
> Roger
>
> P.S: I think postgres is a great product. well done.
>
> --------------------------------------------------
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
> Sent: Thursday, October 25, 2007 3:36 PM
> To: "Roger" <ramoloney@hotmail.com>
> Cc: <pgsql-bugs@postgresql.org>
> Subject: Re: [BUGS] BUG #3695: Pgsql does not report non existing function
>
>> "Roger" <ramoloney@hotmail.com> writes:
>>> Description:        Pgsql does not report non existing function
>>
>> Works fine for me:
>>
>> regression=# create function foo() returns int as $$
>> regression$# declare x int;
>> regression$# begin
>> regression$#   x := nosuchfunc(42);
>> regression$# end$$ language plpgsql;
>> CREATE FUNCTION
>> regression=# select foo();
>> ERROR:  function nosuchfunc(integer) does not exist
>> LINE 1: SELECT  nosuchfunc(42)
>>                ^
>> HINT:  No function matches the given name and argument types. You might
>> need to add explicit type casts.
>> QUERY:  SELECT  nosuchfunc(42)
>> CONTEXT:  PL/pgSQL function "foo" line 3 at assignment
>> regression=#
>>
>> regards, tom lane
>>
>