Re: Question about function body checking and 8.1

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Question about function body checking and 8.1
Дата
Msg-id 200503221944.00883.peter_e@gmx.net
обсуждение исходный текст
Ответ на Re: Question about function body checking and 8.1  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Ответы Re: Question about function body checking and 8.1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Alvaro Herrera wrote:
> On Tue, Mar 22, 2005 at 06:09:28PM +0100, Peter Eisentraut wrote:
> > tony_caduto@amsoftwaredesign.com wrote:
> > > currently when you execute a CREATE OR REPLACE FUNCTION there is
> > > virtually no checking of the function body for variable type
> > > compatibility or if the SQL statements are valid.
> >
> > Only for very small values of "no".  Please provide an example.
>
> Here's a simple one:

Well, mentioning that he was talking about PL/pgSQL would have
helped. :)

Implementing this type of syntax checker isn't hard since the code is
already there, but there might be a small, ugly problem.  IIRC, the
parser and/or semantic analyzer of PL/pgSQL relies on knowing whether
the function is called as a trigger.  You don't know that at creation
phase.  So you'd need to relax the syntax checking in some ill-defined
ways and propagate that relaxation flag all over the place.  But
besides that, this is really just a typing exercise for someone.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Constraint problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Question about function body checking and 8.1