Re: function body error checking issues

From: Neil Conway <neilc(at)samurai(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: tony_caduto(at)amsoftwaredesign(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: function body error checking issues
Date: 2005-02-27 23:47:42
Message-ID: 42225C1E.2030903@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tommy Svensson 2005-02-27 23:50:50 Referencing created tables fails with message that they do not exist!
Previous Message Mohsen Pahlevanzadeh 2005-02-27 23:27:48 Reading from Mysql & writting in PGsql