Minor Feature Request

Поиск
Список
Период
Сортировка
От NielsG
Тема Minor Feature Request
Дата
Msg-id 42530F4C.6060502@aquafold.com
обсуждение исходный текст
Ответы Re: Minor Feature Request  (Kris Jurka <books@ejurka.com>)
Список 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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Paul Marchant
Дата:
Сообщение: Re: getTransactionIsolation() causes SQLException - unrecognized configuration parameter xactisolevel
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Minor Feature Request