Re: function body error checking issues - Mailing list pgsql-general

From Neil Conway
Subject Re: function body error checking issues
Date
Msg-id 42225C1E.2030903@samurai.com
Whole thread Raw
In response to Re: function body error checking issues  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
Bruce Momjian wrote:
> 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

pgsql-general by date:

Previous
From: Robby Russell
Date:
Subject: Re: Referencing created tables fails with message that
Next
From: Ken Johanson
Date:
Subject: Re: Possible to run the server with ANSI/ISO string escapeing