Re: JDBC connections to 9.1

Lists: pgsql-hackerspgsql-jdbc
From: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
To: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: JDBC connections to 9.1
Date: 2011-04-18 13:32:05
Message-ID: 4DAC3D55.1080606@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

I'm getting JDBC exceptions when I try to connect to 9.1 (master) with
the postgresql-9.0-801.jdbc3.jar I don't have this issue with 9.0.

There is nothing obvious at http://jdbc.postgresql.org or in the 9.1
alpha release notes that indicate a newer JDBC driver will be required.

Have other people seen similar issues?

If 9.1 does require a JDBC driver upgrade then it would be good if an
updated driver was posted before we start encouraging people to test
their applications with the beta.

Caused by: org.postgresql.util.PSQLException: Protocol error. Session
setup failed.
at
org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:496)
at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:112)
at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:393)
at org.postgresql.Driver.connect(Driver.java:267)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:200)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
... 14 more


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 13:44:38
Message-ID: 20799.1303134278@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Steve Singer <ssinger(at)ca(dot)afilias(dot)info> writes:
> I'm getting JDBC exceptions when I try to connect to 9.1 (master) with
> the postgresql-9.0-801.jdbc3.jar I don't have this issue with 9.0.

Hmm, what shows up in the postmaster log?

regards, tom lane


From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 14:17:57
Message-ID: 1D1444218CDB28801BEEB27D@apophis.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

--On 18. April 2011 09:44:38 -0400 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>> I'm getting JDBC exceptions when I try to connect to 9.1 (master) with
>> the postgresql-9.0-801.jdbc3.jar I don't have this issue with 9.0.
>
> Hmm, what shows up in the postmaster log?

A quick check with an application here gives the following with JDBC
loglevel=2

16:09:47.910 (1) PostgreSQL 9.1devel JDBC4 (build 900)
16:09:47.914 (1) Trying to establish a protocol version 3 connection to
localhost:5438
16:09:47.930 (1) FE=> StartupPacket(user=bernd, database=mailstore,
client_encoding=UNICODE, DateStyle=ISO, extra_float_digits=2)
16:09:47.933 (1) <=BE AuthenticationOk
16:09:47.942 (1) <=BE ParameterStatus(application_name = )
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(ConnectionFactoryImpl.java:498)
at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:112)
at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
at
org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
at
org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:32)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:393)
at org.postgresql.Driver.connect(Driver.java:267)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at de.oopsware.mailstore.PGSQLMailstore.connect(Unknown Source)
at de.oopsware.mailstore.PGSQLMailstore.connect(Unknown Source)
at mailstore.main(Unknown Source)
SQLException: SQLState(08P01)
getConnection failed: org.postgresql.util.PSQLException: Protocol error.
Session setup failed.
org.postgresql.util.PSQLException: Protocol error. Session setup failed.

Hmm, seems it stumbles while reading client_encoding....

--
Thanks

Bernd


From: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 14:26:59
Message-ID: 4DAC4A33.7060603@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On 11-04-18 09:44 AM, Tom Lane wrote:
> Steve Singer<ssinger(at)ca(dot)afilias(dot)info> writes:
>> I'm getting JDBC exceptions when I try to connect to 9.1 (master) with
>> the postgresql-9.0-801.jdbc3.jar I don't have this issue with 9.0.
>
> Hmm, what shows up in the postmaster log?
>
> regards, tom lane
>

LOG: unexpected EOF on client connection


From: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 14:29:33
Message-ID: 1303136973.2846.16.camel@lenovo01-laptop03.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, 2011-04-18 at 16:17 +0200, Bernd Helmle wrote:
> Hmm, seems it stumbles while reading client_encoding....

This is probably similar to what I had a couple weeks ago. With today's
new minor releases, I get:

$ psql
psql: invalid connection option "client_encoding"

(I was getting another message before)

This is 9.1's psql connecting to 9.1's server. For some reason, psql
uses 9.0 client libs, so if I export LD_LIBRARY_PATH, everything works:

$ LD_LIBRARY_PATH=/usr/pgsql-9.1/lib psql
...

Could it be the same thing?
--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz


From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 14:34:04
Message-ID: 4513A768D798800859BAA819@apophis.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

--On 18. April 2011 16:17:57 +0200 Bernd Helmle <mailings(at)oopsware(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bernd Helmle <mailings(at)oopsware(dot)de>
Cc: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 14:57:07
Message-ID: 22092.1303138627@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Bernd Helmle <mailings(at)oopsware(dot)de> writes:
> If i am reading it correct, it reads "UTF8" from the backend, while
> expecting "UNICODE" only. Not sure what change has caused this,
> though.

I am --- when I redid the GUC assign_hook logic a few weeks ago,
I changed the client_encoding code so that it shows the normalized
(official) name of the encoding, not whatever random string the client
sent over. For instance, previous versions:

regression=# set client_encoding = 'UnIcOdE';
SET
regression=# show client_encoding ;
client_encoding
-----------------
UnIcOdE
(1 row)

versus HEAD:

regression=# set client_encoding = 'UnIcOdE';
SET
regression=# show client_encoding ;
client_encoding
-----------------
UTF8
(1 row)

I wasn't aware that JDBC would fail on that. It's pretty annoying that
it does, but maybe we should grin and bear it, ie revert the change to
canonicalize the GUC's value?

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 15:10:22
Message-ID: BANLkTi=0phhjdrXdu6Wb9LkCZw8D7ujiqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, Apr 18, 2011 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bernd Helmle <mailings(at)oopsware(dot)de> writes:
>> If i am reading it correct, it reads "UTF8" from the backend, while
>> expecting "UNICODE" only. Not sure what change has caused this,
>> though.
>
> I am --- when I redid the GUC assign_hook logic a few weeks ago,
> I changed the client_encoding code so that it shows the normalized
> (official) name of the encoding, not whatever random string the client
> sent over.  For instance, previous versions:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
>  client_encoding
> -----------------
>  UnIcOdE
> (1 row)
>
> versus HEAD:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
>  client_encoding
> -----------------
>  UTF8
> (1 row)
>
> I wasn't aware that JDBC would fail on that.  It's pretty annoying that
> it does, but maybe we should grin and bear it, ie revert the change to
> canonicalize the GUC's value?

Ouch. I hate to revert that, since it seems like a clear improvement.
But I also hate to break JDBC. Ouch.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:11:26
Message-ID: BANLkTinsx=S5wAz+6UEW0yaOuhPCEWpDAg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, Apr 18, 2011 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bernd Helmle <mailings(at)oopsware(dot)de> writes:
>> If i am reading it correct, it reads "UTF8" from the backend, while
>> expecting "UNICODE" only. Not sure what change has caused this,
>> though.
>
> I am --- when I redid the GUC assign_hook logic a few weeks ago,
> I changed the client_encoding code so that it shows the normalized
> (official) name of the encoding, not whatever random string the client
> sent over.  For instance, previous versions:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
>  client_encoding
> -----------------
>  UnIcOdE
> (1 row)
>
> versus HEAD:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
>  client_encoding
> -----------------
>  UTF8
> (1 row)
>
> I wasn't aware that JDBC would fail on that.  It's pretty annoying that
> it does, but maybe we should grin and bear it, ie revert the change to
> canonicalize the GUC's value?
>
>                        regards, tom lane
>

Older drivers will fail for sure. We can fix newer drivers, but if we
leave it we will see a slew of bug reports.

The reason the driver does this is to guarantee the client encoding is unicode.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Bernd Helmle" <mailings(at)oopsware(dot)de>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Steve Singer" <ssinger(at)ca(dot)afilias(dot)info>, "PostgreSQL-development Hackers" <pgsql-hackers(at)postgresql(dot)org>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC connections to 9.1
Date: 2011-04-18 15:13:53
Message-ID: 4DAC0EE1020000250003C947@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I changed the client_encoding code so that it shows the normalized
> (official) name of the encoding, not whatever random string the
> client sent over. For instance, previous versions:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET

The whole area of character sets and encoding schemes is confusing
enough without accepting a character set name as an encoding scheme
specification. I'll bet that in five or ten years we'll be
accepting more than one encoding scheme for the Unicode character
set.

> I wasn't aware that JDBC would fail on that. It's pretty annoying
> that it does, but maybe we should grin and bear it, ie revert the
> change to canonicalize the GUC's value?

Can we fix the JDBC driver rather than reverting this? Long run,
I'd be in favor of just rejecting a character set name as a client
encoding specification. I think inferring one is being generous.

-Kevin


From: Mike Fowler <mike(at)mlfowler(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:14:08
Message-ID: 4DAC5540.2000405@mlfowler.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On 18/04/11 15:57, Tom Lane wrote:
> Bernd Helmle<mailings(at)oopsware(dot)de> writes:
>> If i am reading it correct, it reads "UTF8" from the backend, while
>> expecting "UNICODE" only. Not sure what change has caused this,
>> though.
> I am --- when I redid the GUC assign_hook logic a few weeks ago,
> I changed the client_encoding code so that it shows the normalized
> (official) name of the encoding, not whatever random string the client
> sent over. For instance, previous versions:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
> client_encoding
> -----------------
> UnIcOdE
> (1 row)
>
> versus HEAD:
>
> regression=# set client_encoding = 'UnIcOdE';
> SET
> regression=# show client_encoding ;
> client_encoding
> -----------------
> UTF8
> (1 row)
>
> I wasn't aware that JDBC would fail on that. It's pretty annoying that
> it does, but maybe we should grin and bear it, ie revert the change to
> canonicalize the GUC's value?
>
> regards, tom lane
>
Am I right in thinking that would be that change committed on the 7th
(http://archives.postgresql.org/pgsql-committers/2011-04/msg00039.php) ?
I've just run the JDBC test build on my machine and it fails dismally
with this very message repeated over and over again. What concerns me
most is that (assuming my dates are right) the JDBC driver has been
broken for 11 days and no one noticed. This would lead me to believe
that there is no JDBC build server. What would it take to set one up? If
someone can point me to a test machine I'd happily assist in setting one up.

As for the breakage itself I'm OK with a new driver version for a new
database version and from my experience people expect that. I recall a
number of people asking me if an 8.4 driver would be OK to use against 9
before the 9 version was stable.

Regards,

--
Mike Fowler
Registered Linux user: 379787


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Mike Fowler <mike(at)mlfowler(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:23:22
Message-ID: BANLkTimwKBrCJ+uiC+h_fbOcMUeNO4kCqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, Apr 18, 2011 at 11:14 AM, Mike Fowler <mike(at)mlfowler(dot)com> wrote:
> On 18/04/11 15:57, Tom Lane wrote:
>>
>> Bernd Helmle<mailings(at)oopsware(dot)de>  writes:
>>>
>>> If i am reading it correct, it reads "UTF8" from the backend, while
>>> expecting "UNICODE" only. Not sure what change has caused this,
>>> though.
>>
>> I am --- when I redid the GUC assign_hook logic a few weeks ago,
>> I changed the client_encoding code so that it shows the normalized
>> (official) name of the encoding, not whatever random string the client
>> sent over.  For instance, previous versions:
>>
>> regression=# set client_encoding = 'UnIcOdE';
>> SET
>> regression=# show client_encoding ;
>>  client_encoding
>> -----------------
>>  UnIcOdE
>> (1 row)
>>
>> versus HEAD:
>>
>> regression=# set client_encoding = 'UnIcOdE';
>> SET
>> regression=# show client_encoding ;
>>  client_encoding
>> -----------------
>>  UTF8
>> (1 row)
>>
>> I wasn't aware that JDBC would fail on that.  It's pretty annoying that
>> it does, but maybe we should grin and bear it, ie revert the change to
>> canonicalize the GUC's value?
>>
>>                        regards, tom lane
>>
> Am I right in thinking that would be that change committed on the 7th
> (http://archives.postgresql.org/pgsql-committers/2011-04/msg00039.php) ?
> I've just run the JDBC test build on my machine and it fails dismally with
> this very message repeated over and over again. What concerns me most is
> that (assuming my dates are right) the JDBC driver has been broken for 11
> days and no one noticed. This would lead me to believe that there is no JDBC
> build server. What would it take to set one up? If someone can point me to a
> test machine I'd happily assist in setting one up.
>
> As for the breakage itself I'm OK with a new driver version for a new
> database version and from my experience people expect that. I recall a
> number of people asking me if an 8.4 driver would be OK to use against 9
> before the 9 version was stable.
>
> Regards,
>

One would need a machine which supports java 1.4, 1.5, and 1.6 since
the driver builds all 3 versions. There's actually a 4th between 1.4
and 1.5 but I don't recall the specifics

Dave

> --
> Mike Fowler
> Registered Linux user: 379787
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:24:04
Message-ID: 22630.1303140244@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Dave Cramer <pg(at)fastcrypt(dot)com> writes:
> On Mon, Apr 18, 2011 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I wasn't aware that JDBC would fail on that. It's pretty annoying that
>> it does, but maybe we should grin and bear it, ie revert the change to
>> canonicalize the GUC's value?

> Older drivers will fail for sure. We can fix newer drivers, but if we
> leave it we will see a slew of bug reports.

Yeah. I'm thinking what we should do here is revert the change, with a
note in the source about why, and also change the JDBC driver to send
and expect "UTF8" not "UNICODE" (which as Kevin says is more correct
anyway). Then in a few releases' time we can un-revert the server
change.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Fowler <mike(at)mlfowler(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:25:44
Message-ID: 22674.1303140344@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Mike Fowler <mike(at)mlfowler(dot)com> writes:
> On 18/04/11 15:57, Tom Lane wrote:
>> I am --- when I redid the GUC assign_hook logic a few weeks ago,
>> I changed the client_encoding code so that it shows the normalized
>> (official) name of the encoding, not whatever random string the client
>> sent over. For instance, previous versions:

> Am I right in thinking that would be that change committed on the 7th
> (http://archives.postgresql.org/pgsql-committers/2011-04/msg00039.php) ?

Yes, that one.

> What concerns me
> most is that (assuming my dates are right) the JDBC driver has been
> broken for 11 days and no one noticed. This would lead me to believe
> that there is no JDBC build server. What would it take to set one up?

+1 for doing something along that line.

regards, tom lane


From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 15:42:30
Message-ID: BANLkTimBPNiujPhzCCiGDR5uEqTXHti=Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, Apr 18, 2011 at 11:24 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Dave Cramer <pg(at)fastcrypt(dot)com> writes:
>> On Mon, Apr 18, 2011 at 10:57 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I wasn't aware that JDBC would fail on that.  It's pretty annoying that
>>> it does, but maybe we should grin and bear it, ie revert the change to
>>> canonicalize the GUC's value?
>
>> Older drivers will fail for sure. We can fix newer drivers, but if we
>> leave it we will see a slew of bug reports.
>
> Yeah.  I'm thinking what we should do here is revert the change, with a
> note in the source about why, and also change the JDBC driver to send
> and expect "UTF8" not "UNICODE" (which as Kevin says is more correct
> anyway).  Then in a few releases' time we can un-revert the server
> change.
>

Well initially my concern was that people would have a challenge in
the case where they had to re-certify their application if we made
this change, however I realize they will have to do this anyway since
upgrading to 9.1 is what necessitates it.

So I'm less concerned with bug reports since people can just upgrade both

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 16:12:15
Message-ID: 23604.1303143135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Dave Cramer <pg(at)fastcrypt(dot)com> writes:
> On Mon, Apr 18, 2011 at 11:24 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Yeah. I'm thinking what we should do here is revert the change, with a
>> note in the source about why, and also change the JDBC driver to send
>> and expect "UTF8" not "UNICODE" (which as Kevin says is more correct
>> anyway). Then in a few releases' time we can un-revert the server
>> change.

> Well initially my concern was that people would have a challenge in
> the case where they had to re-certify their application if we made
> this change, however I realize they will have to do this anyway since
> upgrading to 9.1 is what necessitates it.

I don't see any backwards compatibility risk, if that's what you mean.
Every backend release since 7.3 has treated client_encoding 'UTF8' and
'UNICODE' the same, and earlier releases didn't accept either one.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mike Fowler <mike(at)mlfowler(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 16:35:56
Message-ID: 4DAC686C.1040207@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On 04/18/2011 11:25 AM, Tom Lane wrote:
>
>> What concerns me most is that (assuming my dates are right) the JDBC driver has been
>> broken for 11 days and no one noticed. This would lead me to believe
>> that there is no JDBC build server. What would it take to set one up?
> +1 for doing something along that line.
>
>

All you'd need to do is write a step for a buildfarm animal to fetch the
JDBC driver and run some tests, and run it in a buildfarm client
somewhere. The server code is quite agnostic about the steps that are
reported on.

IOW in addition to a running buildfarm member you need to write a small
amount (< 100 lines, possibly much less) of perl code.

cheers

andrew


From: Mike Fowler <mike(at)mlfowler(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 16:40:49
Message-ID: 4DAC6991.6010807@mlfowler.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On 18/04/11 17:35, Andrew Dunstan wrote:
>
>
> On 04/18/2011 11:25 AM, Tom Lane wrote:
>>
>>> What concerns me most is that (assuming my dates are right) the
>>> JDBC driver has been
>>> broken for 11 days and no one noticed. This would lead me to believe
>>> that there is no JDBC build server. What would it take to set one up?
>> +1 for doing something along that line.
>>
>>
>
> All you'd need to do is write a step for a buildfarm animal to fetch
> the JDBC driver and run some tests, and run it in a buildfarm client
> somewhere. The server code is quite agnostic about the steps that are
> reported on.
>
> IOW in addition to a running buildfarm member you need to write a
> small amount (< 100 lines, possibly much less) of perl code.
>
> cheers
>
> andrew

I've found the entry on the Developer Wiki
(http://wiki.postgresql.org/wiki/PostgreSQL_Buildfarm_Howto). What I'll
do is set-up three "farms" on my machine - one for 1.4, one for 1.5 and
one for 1.6. It's been a while since I've had an excuse to write some
Perl! I can't guarantee when I'll have it done as I'm away for a little
over a week from Wednesday and I'm not allowed internet access!

Regards,

--
Mike Fowler
Registered Linux user: 379787


From: Mike Fowler <mike(at)mlfowler(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-18 16:52:23
Message-ID: 4DAC6C47.4060307@mlfowler.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On 18/04/11 17:12, Tom Lane wrote:
> Dave Cramer<pg(at)fastcrypt(dot)com> writes:
>> Well initially my concern was that people would have a challenge in
>> the case where they had to re-certify their application if we made
>> this change, however I realize they will have to do this anyway since
>> upgrading to 9.1 is what necessitates it.
> I don't see any backwards compatibility risk, if that's what you mean.
> Every backend release since 7.3 has treated client_encoding 'UTF8' and
> 'UNICODE' the same, and earlier releases didn't accept either one.
>
> regards, tom lane
>

As there seems to be a consensus forming for fixing the JDBC driver,
I've taken the liberty do so at the risk of being shot down. The patch
is fairly straightforward, just changing UNICODE to UTF8 in a number of
files including the translation files. I've tested this against 9.1devel
(HEAD) and 8.4.7. For each database version I build and the tests
running JDKs 1.4.2_19, 1.5.0_22 and 1.6.0_2. All on 32-bit.

Regards,

--
Mike Fowler
Registered Linux user: 379787

Attachment Content-Type Size
unicode-utf8-jdbc.patch text/x-diff 30.8 KB

From: Kris Jurka <books(at)ejurka(dot)com>
To: Mike Fowler <mike(at)mlfowler(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-19 01:20:30
Message-ID: alpine.BSO.2.00.1104182115350.27592@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Mon, 18 Apr 2011, Mike Fowler wrote:

> On 18/04/11 17:12, Tom Lane wrote:
>> Dave Cramer<pg(at)fastcrypt(dot)com> writes:
>>> Well initially my concern was that people would have a challenge in
>>> the case where they had to re-certify their application if we made
>>> this change, however I realize they will have to do this anyway since
>>> upgrading to 9.1 is what necessitates it.
>> I don't see any backwards compatibility risk, if that's what you mean.
>> Every backend release since 7.3 has treated client_encoding 'UTF8' and
>> 'UNICODE' the same, and earlier releases didn't accept either one.
>>
>> regards, tom lane
>>
>
> As there seems to be a consensus forming for fixing the JDBC driver, I've
> taken the liberty do so at the risk of being shot down. The patch is fairly
> straightforward, just changing UNICODE to UTF8 in a number of files including
> the translation files. I've tested this against 9.1devel (HEAD) and 8.4.7.
> For each database version I build and the tests running JDKs 1.4.2_19,
> 1.5.0_22 and 1.6.0_2. All on 32-bit.
>

Thanks, applied, mostly. It's great to have a patch for a problem before
you even know it exists.

I didn't modify the .po files. I doubt this will change the adjacent
translation wording, but directly patching .po files is only something to
do in more dire circumstances (like needing to make a backpatch to an old
branch that won't get translators to look at it before the next release.)

I also discarded your changes to AbstractJdbc3Statement. Those Unicode
mentions are from the interface Javadoc, so I left them alone.

Kris Jurka


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Mike Fowler <mike(at)mlfowler(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-19 05:38:04
Message-ID: 24102.1303191484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)com> writes:
> On Mon, 18 Apr 2011, Mike Fowler wrote:
>> As there seems to be a consensus forming for fixing the JDBC driver, I've
>> taken the liberty do so at the risk of being shot down. The patch is fairly
>> straightforward, just changing UNICODE to UTF8 in a number of files including
>> the translation files. I've tested this against 9.1devel (HEAD) and 8.4.7.
>> For each database version I build and the tests running JDKs 1.4.2_19,
>> 1.5.0_22 and 1.6.0_2. All on 32-bit.

> Thanks, applied, mostly. It's great to have a patch for a problem before
> you even know it exists.

For purposes of the notes in the server-side fix, could you state which
JDBC driver versions these changes will first appear in?

regards, tom lane


From: Kris Jurka <books(at)ejurka(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mike Fowler <mike(at)mlfowler(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-19 15:16:26
Message-ID: alpine.BSO.2.00.1104191114420.13669@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Tue, 19 Apr 2011, Tom Lane wrote:

> Kris Jurka <books(at)ejurka(dot)com> writes:
>> On Mon, 18 Apr 2011, Mike Fowler wrote:
>>> As there seems to be a consensus forming for fixing the JDBC driver, I've
>>> taken the liberty do so at the risk of being shot down. The patch is fairly
>>> straightforward, just changing UNICODE to UTF8 in a number of files including
>>> the translation files. I've tested this against 9.1devel (HEAD) and 8.4.7.
>>> For each database version I build and the tests running JDKs 1.4.2_19,
>>> 1.5.0_22 and 1.6.0_2. All on 32-bit.
>
>> Thanks, applied, mostly. It's great to have a patch for a problem before
>> you even know it exists.
>
> For purposes of the notes in the server-side fix, could you state which
> JDBC driver versions these changes will first appear in?
>

This is in 9.1dev-900 and won't be backpatched.

http://jdbc.postgresql.org/download.html#development

Kris Jurka


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Mike Fowler <mike(at)mlfowler(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Bernd Helmle <mailings(at)oopsware(dot)de>, Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [JDBC] JDBC connections to 9.1
Date: 2011-04-19 16:32:28
Message-ID: 5030.1303230748@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Kris Jurka <books(at)ejurka(dot)com> writes:
> On Tue, 19 Apr 2011, Tom Lane wrote:
>> For purposes of the notes in the server-side fix, could you state which
>> JDBC driver versions these changes will first appear in?

> This is in 9.1dev-900 and won't be backpatched.

OK, thanks. I've committed a patch to keep the server from
canonicalizing a setting of "UNICODE" (but not any other variations).
That should keep older drivers from breaking, and in a few years we
can remove the kluge, if anyone bothers ...

regards, tom lane