Another version of the patch is attached. Changes:
- clean up grammar so that read_sql_construct() is always called to read
a well-formed SQL expression. That way we can check for errors in
embedded SQL by just adding a single function call to
read_sql_construct(), rather than adding calls at most of its call
- changed location of array overflow checks per Tom
- mostly fixed error message formatting for syntax errors in PL/PgSQL. I
found this part of the ereport() framework rather confusing. The patch
currently emits errors like:
create function bad_sql1() returns int as $$
declare a int;
a := 5;
a := 10;
end$$ language 'plpgsql';
ERROR: syntax error at or near "Johnny"
CONTEXT: SQL statement embedded in PL/PgSQL function "bad_sql1" near
Any suggestions for improvement would be welcome.
Barring any objections, I'd like to apply this patch to HEAD tomorrow.
In response to
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2005-02-10 04:57:07|
|Subject: Re: WIP: pl/pgsql cleanup |
|Previous:||From: Bruce Momjian||Date: 2005-02-10 02:59:11|
|Subject: Re: dbsize patch|