PostgreSQL JDBC Driver 42.2.0 Released

Known issues

  • SCRAM authentication does not work as scram client classes are not packaged
  • client_encoding has to be UTF8 even with allowEncodingChanges=true


  • Support SCRAM-SHA-256 for PostgreSQL 10 in the JDBC 4.2 version (Java 8+) using the Ongres SCRAM library. PR 842
  • Make SELECT INTO and CREATE TABLE AS return row counts to the client in their command tags. Issue 958 PR 962
  • Support Subject Alternative Names for SSL connections. PR 952
  • Support isAutoIncrement metadata for PostgreSQL 10 IDENTITY column. PR 1004
  • Support for primitive arrays PR 887 3e0491a
  • Implement support for get/setNetworkTimeout() in connections. PR 849
  • Make GSS JAAS login optional, add an option “jaasLogin” PR 922 see Connecting to the Database


  • Improve behaviour of ResultSet.getObject(int, Class). PR 932
  • Parse CommandComplete message using a regular expression, allows complete catch of server returned commands for INSERT, UPDATE, DELETE, SELECT, FETCH, MOVE, COPY and future commands. PR 962
  • Use ‘time with timezone’ and ‘timestamp with timezone’ as is and ignore the user provided Calendars, ‘time’ and ‘timestamp’ work as earlier except “00:00:00” now maps to 1970-01-01 and “24:00:00” uses the system provided Calendar ignoring the user-provided one PR 1053
  • Change behaviour of multihost connection. The new behaviour is to try all secondaries first before trying the master PR 844.
  • Avoid reflective access to TimeZone.defaultTimeZone in Java 9+ PR 1002 fixes Issue 986


  • Make warnings available as soon as they are received from the server. This is useful for long running queries, where it can be beneficial to know about a warning before the query completes. PR 857
  • Use 00:00:00 and 24:00:00 for LocalTime. MIN/MAX. PR 992
  • Now the DatabaseMetaData.getFunctions() implementation complies with the JDBC docs. PR 918
  • Execute autosave/rollback savepoint via simple queries always to prevent “statement S_xx not exists” when autosaving fixes Issue #955
  • Received resultset tuples, but no field structure for them" when bind failure happens on 5th execution of a statement Issue 811


  • Drop support for the (insecure) crypt authentication method. PR 1026


  • Reintroduce Driver.getVersion for backward compatibility reasons, mark it as deprecated as application should not rely on it (regression since 42.0.0) 50d5dd3e
  • slave and preferSlave values for the targetServerType connection property have been deprecated in favour of secondary and preferSecondary respectively.

AlexElin (9):

Álvaro Hernández Tortosa (1):

Barnabas Bodnar (1):

  • fix: don’t attempt to read a SQLXML more than once PR 965 8f5e245

Brett Okken (1):

Brett Wooldridge (1):

  • Fixes #638 Implement support for get/setNetworkTimeout() PR 849 8a30044

Chen Huajun (1):

  • fix: improve multihost connection for preferSlave case (verify expired hosts before connecting to cached master) PR 844 c6fec34

Dave Cramer (11):

  • Update thread safety status of the driver to reflect reality; that being that the driver is not thread safe PR 928 ad47aba
  • fix: use 00:00:00 and 24:00:00 for LocalTime. MIN/MAX PR 992 f2d8ec5
  • fix: support Subject Alternative Names for SSL connections PR 952 2dcb91e
  • test: Appveyor configuration PR 1000 059628f
  • add test for identity, fix isAutoincrement in postgresql 10 fixes #130 PR 1004 2f6633b
  • elaborate on sslmode options PR 1054 aa7a420
  • prefer the word secondary over slave PR 1063 2e8c2b6
  • Revert “refactor: replace some usages of initCause PR 1037” (#1064) e6a1ecc
  • prefer secondary over slave referring to standby or secondary servers PR 1070 32c53902
  • first pass at release notes and some fixes to previous notes PR 1041 a8260f5
  • Update b36867f

Hugh Cole-Baker (1):

Jeff Klukas (1):

Joe Kutner (1):

  • fix: Added support for socksNonProxyHosts property PR 975 (#985) 9813c68

Jorge Solorzano (13):

Magnus (1):

  • fix: make warnings available as soon as they are received PR 857 83dd5fe

Magnus Hagander (1):

MichaelZg (1):

  • fix: trim trailing zeros in timestamp strings returned in binary mode PR 896 d28deff

Michael Glaesemann (1):

  • refactor: use TypeInfo getPGArrayType instead of munging type name PR 913 634e157

Pavel Raiskup (2):

  • packaging: rpm_ci: add missing BuildRequires 4e0cdc1
  • packaging: rpm_ci: don’t shade scram jar into pgjdbc 1fd6c4f

Philippe Marschall (2):

Piyush Sharma (1):

  • doc: Added quotes to URL in ‘@see’ tag over org.postgresql.sspi. NTDSAPI#DsMakeSpnW for syntactic correctness PR 926 29f574a

Sehrope Sarkuni (1):

Thach Hoang (2):

  • Update ServerVersionTest to actually compare versions PR 1015 cccd6cd
  • fix: always return Short[] for java.sql. Array.getArray() on smallint[] PR 1017 279fb43

Vladimir Sitnikov (23):

  • fix: reintroduce Driver.getVersion for backward compatibility reasons PR 905 50d5dd3
  • style: make PGReplicationStream, LargeObject implement AutoCloseable for Java 7+ PR 1016 9f07c9a
  • fix: prevent statement hang in case close() called when query is in progress PR 1022 04c5dbb
  • fix: synchronize Statement#result field access to make #close() more thread-safe 4139248
  • fix: avoid reflective access to TimeZone.defaultTimeZone in Java 9+ PR 1002 fd0eeee
  • fix: throw TOO_MANY_RESULTS (0100E) instead of “PgResultSet: tuples must be non-null” 0d31d46
  • fix: “Received resultset tuples, but no field structure for them” when bind failure happens on 5th execution of a statement PR 811 082d009
  • tests: correct assertion to use proper column 63918eb
  • fix: add type parameter so code is Java 6/7 compatible 1361c52
  • chore: avoid non-blocking IO for stdout to workaround “stdout: write error” in Travis 12bb084
  • test: run Travis tests with non-default time zone a3982b4
  • fix: execute autosave/rollback savepoint via simple queries always to prevent “statement S_xx not exists” when autosaving PR 955 684a699
  • fix: use ‘time with time zone’ and ‘timestamp with time zone’ values as is and avoid computation with user-provided/default Calendars e8c43f3
  • test: refactor SetObject310Test to use proper assertion messages and use less statements (make it faster) be06946
  • refactor: factor out receiveParameterStatus so all the ParameterStatus messages are handled in the same way a94cfea
  • fix: add Provide-Capability OSGi manifest PR 1029 236805b
  • chore: update version to 42.2.0-SNAPSHOT to reflect the next release version e27ee74
  • packaging: add missing maven-clean-plugin dependency a2ed9b5
  • chore: introduce release via Travis acb9bdd
  • chore: skip CI builds for tags; skip Fedora and extendedCacheEverything jobs when building pull requests 3ba3b63
  • fix: avoid NPE from getObject(…, Date.class) and getObject(…, Calendar.class) on null timestamps PR 1071 eb33c4c
  • test: add “as” to test queries so they work with PostgreSQL 8.3 71b3c11
  • docs: make pgjdbc’s javadocs to inherit base Java documentation eb406dc

Zemian Deng (3):

  • refactor: use PGProperty enum instead of text ref for targetServerType, hostRecheckSeconds, loadBalanceHosts PR 912 (#915) b0cfc33
  • fix: correct javadoc on PGResultSetMetaData.getFormat PR 917 cd77693
  • fix: Correct DatabaseMetaData.getFunctions() implementation PR 918 8884202

bpd0018 (3):

djydewang (1):

  • style: disallowing user to use incomplete fully qualified Check names in config file PR 961 3286c8c

eperez (1):

mjanczykowski (1):

rnveach (1):

  • style: remove deprecated maxLineLength from LeftCurlyCheck PR 904 5f083d1

steinarb (1):

  • fix: add Provide-Capability org.osgi.service.jdbc. DataSourceFactory to OSGi manifest Issue 1029

zapov (1):

  • fix: avoid integer overflow when sending large arguments PR 946 266ed61

Contributors to this release

We thank the following people for their contributions to this release.


Álvaro Hernández Tortosa

Barnabas Bodnar

Brett Okken

Brett Wooldridge

Chen Huajun

Dave Cramer

Hugh Cole-Baker

Jeff Klukas

Joe Kutner

Jorge Solorzano


Magnus Hagander


Michael Glaesemann

Pavel Raiskup

Philippe Marschall

Piyush Sharma

Sehrope Sarkuni

Thach Hoang

Vladimir Sitnikov

Zemian Deng