From: NielsG <NielsG@aquafold.com>
To: pgsql-jdbc@postgresql.org
To: books@ejurka.com
Subject: Minor Feature Request
Date: Tue, 05 Apr 2005 15:21:00 -0700
Message-ID: <42530F4C.6060502@aquafold.com> (raw)
Hi,
I am trying to figure out if I can get the line number, when executing a
"CREATE FUNCTION" statement which fails. The line number of where the
error occurs.
For example, if I execute:
CREATE OR REPLACE FUNCTION "public"."new_func" (xid, xid) RETURNS bool AS
'
BEGIN
IFsss $2 IS NULL THEN
return ''NULL'';
ELSE
return ''NOT_NULL'';
END IF;
END
' LANGUAGE 'plpgsql'
I would like to get back the line number 4, which is the line in where
the syntax error occurs. Could this be placed in the
SQLException.getMessage() text? If so, then I can parse out the line
number for my use. Otherwise, I can't find the line number anywhere.
Example: [ERROR: Line 4: syntax error at or near "ELSE"]
In PGAdmin you get the line number in the text message, but I assume it
is using the native API. In a Java Query tool which uses JDBC the line
number would be nice.
thanks
-Niels
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: NielsG@aquafold.com, books@ejurka.com
Subject: Re: Minor Feature Request
In-Reply-To: <42530F4C.6060502@aquafold.com>
References: <42530F4C.6060502@aquafold.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox