Minor Feature Request

From: NielsG <NielsG(at)aquafold(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org, books(at)ejurka(dot)com
Subject: Minor Feature Request
Date: 2005-04-05 22:21:00
Message-ID: 42530F4C.6060502@aquafold.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2005-04-05 22:49:49 Re: Minor Feature Request
Previous Message Paul Marchant 2005-04-05 18:08:37 Re: getTransactionIsolation() causes SQLException - unrecognized configuration parameter xactisolevel