Re: JDBC connections to 9.1

Bernd Helmle <mailings@oopsware.de>

From: Bernd Helmle <mailings@oopsware.de>
To: Tom Lane <tgl@sss.pgh.pa.us>, Steve Singer <ssinger@ca.afilias.info>
Cc: PostgreSQL-development Hackers <pgsql-hackers@postgresql.org>
Date: 2011-04-18T14:34:04Z
Lists: pgsql-hackers

--On 18. April 2011 16:17:57 +0200 Bernd Helmle <mailings@oopsware.de> wrote:

> 16:09:47.942 (1)  <=BE ParameterStatus(client_encoding = UTF8)
> org.postgresql.util.PSQLException: Protocol error.  Session setup failed.
> 	at
> org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFa
> ctoryImpl.java:498)

ConnectionFactoryImpl.readStartupMessages() has this:

                else if (name.equals("client_encoding")) 

                { 

                    if (!value.equals("UNICODE")) 

                        throw new PSQLException(GT.tr("Protocol error.  Session 
setup failed."), PSQLState.PROTOCOL_VIOLATION);
 
pgStream.setEncoding(Encoding.getDatabaseEncoding("UNICODE")); 

                }

If i am reading it correct, it reads "UTF8" from the backend, while expecting 
"UNICODE" only. Not sure what change has caused this, though. If i extend the 
check to include "UTF8", everything seems to work.

-- 
Thanks

	Bernd