Syntax error reporting has been improved in our code so 8.1 might be better and catching such errors.
Yes, current sources catches this at definition-time:
% psql -f test.sql
psql:test.sql:21: ERROR: syntax error at or near "EXCEPTIONRATIO_OUT" at character 1
QUERY: EXCEPTIONRATIO_OUT = 0
CONTEXT: SQL statement in PL/PgSQL function "get_ratio" near line 13
psql:test.sql:21: LINE 1: EXCEPTIONRATIO_OUT = 0
psql:test.sql:21: ^
If folks have more suggestions for improving pl/pgsql compile-time error checking, speak up. I'm also planning to implement trivially-dead-code detection (like statements that follow a RETURN, and so on), although that's not in HEAD yet.
-Neil
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq