Re: 8.1 and syntax checking at create time

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: 8.1 and syntax checking at create time
Дата
Msg-id 200508311159.47325.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: 8.1 and syntax checking at create time  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
Ответы Re: 8.1 and syntax checking at create time  (Matt Miller <mattm@epx.com>)
Re: 8.1 and syntax checking at create time  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
Tony,

>  From what I have seen it does not check anything in the body of the
> function, I can put gibberish in the body as long as it has a begin and
> end.

Nope:

stp=# create function bad_stuff ( x boolean ) returns boolean as $x$
stp$# begin
stp$# afasdfasdfasdf;
stp$# afasdfasdfa;
stp$# asdfasfasdf;
stp$# end;
stp$# $x$ language plpgsql;
ERROR:  syntax error at or near "afasdfasdfasdf" at character 1
QUERY:  afasdfasdfasdf
CONTEXT:  SQL statement in PL/PgSQL function "bad_stuff" near line 2
ERROR:  syntax error at or near "afasdfasdfasdf" at character 1
QUERY:  afasdfasdfasdf
CONTEXT:  SQL statement in PL/PgSQL function "bad_stuff" near line 2
LINE 1: afasdfasdfasdf

Are you sure you don't have check_function_bodies = Off?

There is a  difference between *syntax* errors and *sql* errors.    If a 
table does not exist, we don't want to check for that and bounce the 
function; possibly the function will only be called in a context where the 
table does exist.

-- 
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: 8.1 and syntax checking at create time
Следующее
От: Tony Caduto
Дата:
Сообщение: Re: 8.1 and syntax checking at create time