Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4JEx3A45611 for ; Sat, 19 May 2001 10:59:04 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4JEwmR29973; Sat, 19 May 2001 10:58:48 -0400 (EDT) To: Richard Huxton cc: Bruno Boettcher , pgsql-sql@postgresql.org, Jan Wieck Subject: Re: HELP: what's wrong with my PL/PSQL function?? In-reply-to: <3B0661ED.B43C0DC6@archonet.com> References: <20010518112136.A468@erm1.u-strasbg.fr> <3B0661ED.B43C0DC6@archonet.com> Comments: In-reply-to Richard Huxton message dated "Sat, 19 May 2001 13:07:08 +0100" Date: Sat, 19 May 2001 10:58:48 -0400 Message-ID: <29970.990284328@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/208 X-Sequence-Number: 3025 Richard Huxton 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