Alvaro Herrera <[EMAIL PROTECTED]> writes:
> alvherre=# create function test_syntax() returns void language plpgsql as 
> 'begin zelect 1; return; end';
> CREATE FUNCTION
> alvherre=# select test_syntax();
> ERROR:  error de sintaxis en o cerca de «zelect» en el carácter 1
> QUERY:  zelect 1
> CONTEXT:  PL/pgSQL function "test_syntax" line 1 at SQL statement
> LINEA 1: zelect 1
>          ^
> alvherre=# 

Of course, Neil fixed that one already.  It's still true that plpgsql
doesn't do any *semantic* analysis to speak of at function definition
time.  I gather that Tony's users are looking for more than bare syntax
checking.

I'm not sure how much we could really do though; the obvious idea of
trying to test-plan each query in the function will fail on cases like

        begin
                create temp table foo ...;
                insert into foo ...;

(And before you object that that doesn't work anyway, it probably will
once Neil gets done with cached-plan invalidation.)

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to