Function syntax checking

Поиск
Список
Период
Сортировка
От Karim Nassar
Тема Function syntax checking
Дата
Msg-id 1098656429.9589.355.camel@localhost
обсуждение исходный текст
Ответы Re: Function syntax checking  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am writing functions and I find it curious that CREATE FUNCTION does
not do syntax checking.

Example:

test=# CREATE FUNCTION foo(INTEGER) RETURNS BOOLEAN
test-# AS 'this is total crap' LANGUAGE plpgsql;
CREATE FUNCTION
test=# select foo(1);
ERROR:  syntax error at or near "this"
CONTEXT:  compile of PL/pgSQL function "foo" near line 1

The statement itself is valid, but the function causes runtime syntax
errors. Seems like one could run the interpreter with bogus, but
syntactically correct arguments to the function, creating the
instruction tree. Then run through the tree and try to create execution
plans for all the statements. The cost of this would be well worth *my*
time ;-)

Is there a technical reason this doesn't happen?

TIA,
\<.



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

Предыдущее
От: stig erikson
Дата:
Сообщение: Re: The data directory was initialized by PostgreSQL version 7.3,
Следующее
От: Karim Nassar
Дата:
Сообщение: Re: Bug or stupidity