Thread: BUG #15013: JNI-JDBC: org.postgresql.util.PSQLException: FEHLER: ungültiges Message-Format

BUG #15013: JNI-JDBC: org.postgresql.util.PSQLException: FEHLER: ungültiges Message-Format

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      15013
Logged by:          Junior Tcheho
Email address:      jt@leutek.de
PostgreSQL version: 10.1
Operating system:   Windows 2008 Server R2
Description:

Hello,

I get the following error after execution a query which was created throw
JNI:
org.postgresql.util.PSQLException: FEHLER: ungültiges Message-Format.

I have created the String for the query using the call:
String(byte[] bytes, String charsetName).


When working with env->NewStringUTF(pcCharArray), there is no error, but not
all characters are properly handled. E.g: €(Euro-Char)

Regard.
 Junior Tcheho


Hi,

I'm at a loss here. What interface is this ? pl/java ?

Dave Cramer

On 17 January 2018 at 09:26, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15013
Logged by:          Junior Tcheho
Email address:      jt@leutek.de
PostgreSQL version: 10.1
Operating system:   Windows 2008 Server R2
Description:

Hello,

I get the following error after execution a query which was created throw
JNI:
org.postgresql.util.PSQLException: FEHLER: ungültiges Message-Format.

I have created the String for the query using the call:
String(byte[] bytes, String charsetName).


When working with env->NewStringUTF(pcCharArray), there is no error, but not
all characters are properly handled. E.g: €(Euro-Char)

Regard.
 Junior Tcheho


Hello.

At Thu, 18 Jan 2018 14:33:35 -0500, Dave Cramer <davecramer@gmail.com> wrote in
<CADK3HHK+JXypTQ1dVCXNTS2GP69MmXzV40iJicaH=b=1CpyuOg@mail.gmail.com>
> Hi,
> 
> I'm at a loss here. What interface is this ? pl/java ?
> 
> Dave Cramer

It seems a CPU-native client program that uses JDBC driver via
JNI and some kind of protocol error happened. (I recomment to use
libpq directly..)

At first, please provide the version of the JDBC driver and a
full stack exception, not only the last one, then ask the
following mailling list.

https://jdbc.postgresql.org/community/mailinglist.html#general

If you can parepre a small self-contained stuff to replay your
problem, it would be a great help for others. I suppose it is
feasible as a small Java program not using JNI.

> 
> On 17 January 2018 at 09:26, PG Bug reporting form <noreply@postgresql.org>
> wrote:
> 
> > The following bug has been logged on the website:
> >
> > Bug reference:      15013
> > Logged by:          Junior Tcheho
> > Email address:      jt@leutek.de
> > PostgreSQL version: 10.1
> > Operating system:   Windows 2008 Server R2
> > Description:
> >
> > Hello,
> >
> > I get the following error after execution a query which was created throw
> > JNI:
> > org.postgresql.util.PSQLException: FEHLER: ungültiges Message-Format.
> >
> > I have created the String for the query using the call:
> > String(byte[] bytes, String charsetName).
> >
> >
> > When working with env->NewStringUTF(pcCharArray), there is no error, but
> > not
> > all characters are properly handled. E.g: €(Euro-Char)

It takes (modified) UTF8 string. As far as I can see '0x80' (�
in CP1252) doesn't work for the function..

If you NewByteArray'ed the pcCharArray and using "CP1252" in the
former case, it would work on a German environment and you will
get 'ungültige Zeichenkette in Message' instead if something's
wrong in sending a query. It seems that the error happend at bind
time. Anyway full stack exception gives a crue to that.


> > Regard.
> >  Junior Tcheho

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center