From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Richard Huxton <dev(at)archonet(dot)com> |
Cc: | Bruno Boettcher <bboett(at)erm1(dot)u-strasbg(dot)fr>, pgsql-sql(at)postgresql(dot)org, Jan Wieck <JanWieck(at)Yahoo(dot)com> |
Subject: | Re: HELP: what's wrong with my PL/PSQL function?? |
Date: | 2001-05-19 14:58:48 |
Message-ID: | 29970.990284328@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Richard Huxton <dev(at)archonet(dot)com> writes:
> Bruno Boettcher wrote:
>> and i get an error:
>> ERROR: parser: parse error at or near "$1"
>> (BTW would be helpful if the thing could spit out also the line
>> number....)
> You can get syntax error line-numbers by editing the function in a
> text-file and \i file to import it. Otherwise, plpgsql's error reporting
> is a bit weak.
Actually, plpgsql DOES report the line number. Into the postmaster log.
For example:
regression=# create function zz() returns int as '
regression'# begin
regression'# x := x + 1;
regression'# return x;
regression'# end;' language 'plpgsql';
CREATE
regression=# select zz();
ERROR: parser: parse error at or near "x"
regression=#
tail postmaster.log shows
ERROR: parser: parse error at or near "x"
DEBUG: Last error occured while executing PL/pgSQL function zz
DEBUG: line 2 at SQL statement
I am not sure why this precious info is so deeply buried. I know why
it's not part of the ERROR itself: our elog mechanism doesn't support
that. But seems like it could at least be made a NOTICE rather than a
DEBUG message.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Per-Olof Pettersson | 2001-05-19 19:24:54 | Create an empty record |
Previous Message | Richard Huxton | 2001-05-19 12:07:08 | Re: HELP: what's wrong with my PL/PSQL function?? |