postgresql-jdbc.git / summary / log / commit / refs
commit cf6b836c2acbddc12f74944534fddeb012df4fdb
Author: Jorge Solorzano <jorsol@gmail.com>
Commit: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Date: Mon Oct 17 08:33:01 2016 +0000
docs: improve readme.md (#666)
CONTRIBUTING.md | 256 ++++++++++++++++++++++++++++
README.md | 504 +++++++++++++++-----------------------------------------
2 files changed, 389 insertions(+), 371 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 88c480c2..62a775d8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,6 +23,262 @@ desired feature or improvement happens is to implement it yourself. The PgJDBC
sources are reasonably clear and they're pure Java, so it's sometimes easier
than you might expect.
+## Build requirements
+
+In order to build the source code for PgJDBC you will need the following tools:
+
+- A git client
+- A recent version of Maven (3.x)
+- A JDK for the JDBC version you'd like to build (JDK6 for JDBC 4, JDK7 for JDBC 4.1 or JDK8 for JDBC 4.2)
+- A running PostgreSQL instance
+
+Additionally, in order to update translations (not typical), you will need the following additional tools:
+
+- the gettext package, which contains the commands "msgfmt", "msgmerge", and "xgettext"
+
+## Checking out the source code
+
+The PgJDBC project uses git for version control. You can check out the current code by running:
+
+ git clone https://github.com/pgjdbc/pgjdbc.git
+
+This will create a pgjdbc directory containing the checked-out source code.
+In order do build jre7 or jre6 compatible versions, check out those repositories under `pgjdbc`
+
+ cd pgjdbc # <-- that is pgjdbc/pgjdbc.git clone
+ git clone https://github.com/pgjdbc/pgjdbc-jre7.git
+ git clone https://github.com/pgjdbc/pgjdbc-jre6.git
+
+Note: all the source code is stored in `pgjdbc.git` repository, so just `pgjdbc.git` is sufficient for development.
+
+## Compiling with Maven on the command line
+
+After checking out the code you can compile and test the PgJDBC driver by running the following
+on a command line:
+
+ mvn package
+
+Note: if you want to skip test execution, issue `mvn package -DskipTests`.
+
+Note: in certain cases, proper build requires cleaning the results of previous one.
+For instance, if you remove a `.java` file, then clean is required to remove the relevant `.class` file.
+In such cases, use `mvn clean` or `mvn clean package`.
+
+PgJDBC doesn't natively support building from IDEs like Eclipse, NetBeans or
+IntelliJ. However you can use the tools Maven support from within the IDE if you wish.
+You can use regular IDE tools to develop, execute tests, etc, however if you want to build final
+artifacts you should use `mvn`.
+
+After running the build , and build a .jar file (Java ARchive)
+depending on the version of java and which release you have the jar will be named
+postgresql-<major>.<minor>.<release>.jre<N>.jar. Where major,minor are the PostgreSQL major,minor
+version numbers. release is the jdbc release number. N is the version of the JDBC API which
+corresponds to the version of Java used to compile the driver.
+
+The target directory will contain the driver jar.
+If you need source code, documentation and runtime dependencies use `mvn package -P release-artifacts`.
+
+*NOTE*: default build produces Java 8 (JDBC 4.2) driver (in `pgjdbc/target` folder).
+
+If you need a version for older Java, configure `~/.m2/toolchains.xml`.
+Here's sample configuration for macOS:
+```xml
+<?xml version="1.0" encoding="UTF8"?>
+<toolchains>
+ <!-- JDK toolchains -->
+ <toolchain>
+ <type>jdk</type>
+ <provides>
+ <version>1.6</version>
+ <vendor>oracle</vendor>
+ </provides>
+ <configuration>
+ <jdkHome>/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home</jdkHome>
+ </configuration>
+ </toolchain>
+ <toolchain>
+ <type>jdk</type>
+ <provides>
+ <version>1.7</version>
+ <vendor>oracle</vendor>
+ </provides>
+ <configuration>
+ <jdkHome>/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home</jdkHome>
+ </configuration>
+ </toolchain>
+ <toolchain>
+ <type>jdk</type>
+ <provides>
+ <version>1.8</version>
+ <vendor>oracle</vendor>
+ </provides>
+ <configuration>
+ <jdkHome>/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home</jdkHome>
+ </configuration>
+ </toolchain>
+</toolchains>
+```
+
+## Updating translations
+
+From time to time, the translation packages will need to be updated as part of the build process.
+However, this is atypical, and is generally only done when needed such as by a project committer before a major release.
+This process adds additional compile time and generally should not be executed for every build.
+
+Updating translations can be accomplished with the following command:
+
+ mvn -Ptranslate compile && git add pgjdbc && git commit -m "Translations updated"
+
+Note that the maven profile "translate" can safely be called with other profiles, such as -P release-artifacts.
+Invocation of this command will generate new .po files, a new messages.pot file, and newly translated class files.
+
+## Releasing a snapshot version
+
+TravisCI automatically deploys snapshots for each commit to master branch.
+
+Git repository typically contains -SNAPSHOT versions, so you can use the following command:
+
+ mvn deploy && (cd pgjdbc-jre7; mvn deploy) && (cd pgjdbc-jre6; mvn deploy)
+
+## Releasing a new version
+
+Prerequisites:
+- JDK 6, JDK 7, and JDK8 configured in `~/.m2/toolchains.xml`
+- a PostgreSQL instance for running tests
+- ensure that the RPM packaging CI isn't failing at
+ [copr web page](https://copr.fedorainfracloud.org/coprs/g/pgjdbc/pgjdbc-travis/builds/) -
+ possibly bump `parent poms` or `pgjdbc` versions in RPM [spec file](packaging/rpm/postgresql-jdbc.spec).
+
+Procedure:
+
+Release a version for JDK8
+- From a root folder, perform `mvn release:clean release:prepare`. That will ask you new version, update pom.xml, commit and push it to git.
+- From a root folder, perform `mvn release:perform`. That will *stage* Java 8-compatible PgJDBC version to maven central.
+
+Release a version for JDK7
+- Update `pgjdbc` submodule in `pgjdbc-jre7`
+
+```
+cd pgjdbc-jre7/pgjdbc
+git checkout master
+git reset --hard REL9.4.1208
+cd ..
+git add pgjdbc
+git commit -m "Update pgjdbc"
+```
+
+- Release `pgjdbc-jre7`
+
+```
+mvn release:clean release:prepare release:perform
+```
+
+Release a version for JDK6
+- Update `pgjdbc` submodule in `pgjdbc-jre7`
+- Release `pgjdbc-jre6`
+
+```
+mvn release:clean release:prepare release:perform
+```
+
+Close staging repository and release it:
+- From a `pgjdbc` folder, perform
+
+```
+mvn nexus-staging:close -DstagingRepositoryId=orgpostgresql-1082
+```
+
+The staged repository will become open for smoke testing access at https://oss.sonatype.org/content/repositories/orgpostgresql-1082/
+
+If staged artifacts look fine, release it
+
+```
+ mvn nexus-staging:release -DstagingRepositoryId=orgpostgresql-1082
+```
+
+Update changelog:
+- run `./release_notes.sh`, edit as desired
+
+## Dependencies
+
+PgJDBC has optional dependencies on other libraries for some features. These
+libraries must also be on your classpath if you wish to use those features; if
+they aren't, you'll get a `PSQLException` at runtime when you try to use features
+with missing libraries.
+
+Maven will download additional dependencies from the Internet (from Maven
+repositories) to satisfy build requirements. Whether or not you intend to use
+the optional features the libraries used to implement them they *must* be present to
+compile the driver.
+
+Currently Waffle-JNA and its dependencies are required for SSPI authentication
+support (only supported on a JVM running on Windows). Unless you're on Windows
+and using SSPI you can leave them out when you install the driver.
+
+## Installing the driver
+
+To install the driver, the postgresql jar file has to be in the classpath.
+When running standalone Java programs, use the `-cp` command line option,
+e.g.
+
+ java -cp postgresql-<major>.<minor>.<release>.jre<N>.jar -jar myprogram.jar
+
+If you're using an application server or servlet container, follow the
+instructions for installing JDBC drivers for that server or container.
+
+For users of IDEs like Eclipse, NetBeans, etc, you should simply add the
+driver JAR like any other JAR to use it in your program. To use it within
+the IDE itself (for database browsing etc) you should follow the IDE
+specific documentation on how to install JDBC drivers.
+
+## Bug reports, patches and development
+
+PgJDBC development is carried out on the [PgJDBC mailing list](https://jdbc.postgresql.org/community/mailinglist.html) and on [GitHub](https://github.com/pgjdbc/pgjdbc).
+
+Set of "backend protocol missing features" is collected in [backend_protocol_v4_wanted_features.md](backend_protocol_v4_wanted_features.md)
+
+### Bug reports
+
+For bug reports please post on pgsql-jdbc or add a GitHub issue. If you include
+additional unit tests demonstrating the issue, or self-contained runnable test
+case including SQL scripts etc that shows the problem, your report is likely to
+get more attention. Make sure you include appropriate details on your
+environment, like your JDK version, container/appserver if any, platform,
+PostgreSQL version, etc. Err on the site of excess detail if in doubt.
+
+### Bug fixes and new features
+
+If you've developed a patch you want to propose for inclusion in PgJDBC, feel
+free to send a GitHub pull request or post the patch on the PgJDBC mailing
+list. Make sure your patch includes additional unit tests demonstrating and
+testing any new features. In the case of bug fixes, where possible include a
+new unit test that failed before the fix and passes after it.
+
+For information on working with GitHub, see: http://help.github.com/articles/fork-a-repo and http://learn.github.com/p/intro.html.
+
+### Testing
+
+Remember to test proposed PgJDBC patches when running against older PostgreSQL
+versions where possible, not just against the PostgreSQL you use yourself.
+
+You also need to test your changes with older JDKs. PgJDBC must support JDK6
+("Java 1.6") and newer. Code that is specific to a particular spec version
+may use features from that version of the language. i.e. JDBC4.1 specific
+may use JDK7 features, JDBC4.2 may use JDK8 features.
+Common code and JDBC4 code needs to be compiled using JDK6.
+
+Three different versions of PgJDBC can be built, the JDBC 4, 4.1 and 4.2 drivers.
+These require JDK6, JDK7 and JDK8 respectively.
+The driver to build is auto-selected based on the JDK version used to run the
+build. The best way to test a proposed change is to build and test with JDK6, 7 and 8.
+
+You can get old JDK versions from the [Oracle Java Archive](http://www.oracle.com/technetwork/java/archive-139210.html).
+
+Then, to test against old JDK, run `mvn test` in `pgjdbc-jre6` or `pgjdbc-jre7` modules.
+
+For information about the unit tests and how to run them, see
+ [org/postgresql/test/README](pgjdbc/src/test/java/org/postgresql/test/README.md)
+
## Support for IDEs
It's possible to debug and test PgJDBC with various IDEs, not just with mvn on
diff --git a/README.md b/README.md
index eb69a2c1..fc4fd7ff 100644
--- a/README.md
+++ b/README.md
@@ -1,94 +1,62 @@
-<img src="http://developer.postgresql.org/~josh/graphics/logos/elephant-64.png" />
-# PostgreSQL JDBC driver
+<img height="90" align="right" src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/40/Wave.svg/133px-Wave.svg.png" />
+<img height="90" align="right" src="https://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Postgresql_elephant.svg/200px-Postgresql_elephant.svg.png" />
+# PostgreSQL JDBC Driver
+
+PostgreSQL JDBC Driver (PgJDBC for short) allows Java programs to connect to a PostgreSQL database using standard, database independent Java code. Is an open source JDBC driver written in Pure Java (Type 4), and communicates in the PostgreSQL native network protocol.
+
+### Status
[](https://travis-ci.org/pgjdbc/pgjdbc)
[](http://codecov.io/github/pgjdbc/pgjdbc?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/org.postgresql/postgresql)
[](http://javadoc.io/doc/org.postgresql/postgresql)
+[](https://opensource.org/licenses/BSD-2-Clause)
[](https://gitter.im/pgjdbc/pgjdbc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-This is a simple readme describing how to compile and use the PostgreSQL JDBC driver.
-
- - [Commit Message Guidelines](CONTRIBUTING.md#commit)
-
-## Info
-
-This isn't a guide on how to use JDBC - for that refer to [Oracle's website](http://www.oracle.com/technetwork/java/javase/jdbc/) and the [JDBC tutorial](http://docs.oracle.com/javase/tutorial/jdbc/).
-
-For problems with this driver, refer to driver's [home page](https://jdbc.postgresql.org/) and associated [mailing list](https://archives.postgresql.org/pgsql-jdbc/).
-
-## Downloading pre-built drivers
-
-Most people do not need to compile PgJDBC. You can download prebuilt versions of the driver
-from the [PostgreSQL JDBC site](https://jdbc.postgresql.org/) or using your chosen dependency management tool:
-
-## Changelog
-
-Notable changes for 9.4.1211 (2016-09-18):
-* json type is returned as PGObject like in pre-9.4.1210 (fixed regression of 9.4.1210)
-* 'current transaction is aborted' exception includes the original exception via caused-by chain
-
-Notable changes for 9.4.1210 (2016-09-07):
-* BUG: json datatype is returned as java.lang.String object, not as PGObject (fixed in 9.4.1211)
-* Better support for RETURN_GENERATED_KEYS, statements with RETURNING clause
-* Avoid user-visible prepared-statement errors if client uses DEALLOCATE/DISCARD statements (invalidate cache when those statements detected)
-* Avoid user-visible prepared-statement errors if client changes search_path (invalidate cache when set search_path detected)
-* Support comments when replacing {fn ...} JDBC syntax
-* Support for Types.REF_CURSOR
-
-Notable changes for 9.4.1209 (2016-07-15):
-* Many improvements to `insert into .. values(?,?)` => `insert .. values(?,?), (?,?)...` rewriter. Give it a try by using `reWriteBatchedInserts=true` connection property. 2-3x improvements for insert batch can be expected
-* Full test suite passes against PostgreSQL 9.6, and OpenJDK 9
-* Performance optimization for timestamps (~`TimeZone.getDefault` optimization)
-* Allow build-from-source on GNU/Linux without maven repositories, and add Fedora Copr test to the regression suite
+## Supported PostgreSQL and Java versions
+The current version of the driver should be compatible with **PostgreSQL 8.2 and higher** using the version 3.0 of the protocol, and **Java 6** (JDBC 4.0), **Java 7** (JDBC 4.1) and **Java 8** (JDBC 4.2). Unless you have unusual requirements (running old applications or JVMs), this is the driver you should be using.
-Full change log can be found here: https://jdbc.postgresql.org/documentation/changelog.html#introduction
+Don't assume that the current version of PgJDBC 9.4.x is only PostgreSQL 9.4 compatible. PgJDBC regression tests are run against all PostgreSQL versions since 8.4, including "build PostgreSQL from git master" version. There are other derived forks of PostgreSQL but have not been certified to run with PgJDBC.
-## Supported PostgreSQL versions
+## Get the Driver
+Most people do not need to compile PgJDBC. You can download the precompiled driver (jar) from the [PostgreSQL JDBC site](https://jdbc.postgresql.org/download.html) or using your chosen dependency management tool:
-Pgjdbc regression tests are run against all PostgreSQL versions since 8.4, including "build PostgreSQL from git master" version.
-Don't assume pgjdbc 9.4.x is only PostgreSQL 9.4 compatible.
+### Maven Central
+You can search on The Central Repository with GroupId and ArtifactId [][mvn-search] for:
-### Maven
+[][mvn-jre8]
```xml
<dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <version>9.4.1211</version> <!-- Java 8 -->
- <version>9.4.1211.jre7</version> <!-- Java 7 -->
- <version>9.4.1211.jre6</version> <!-- Java 6 -->
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.4.1211</version>
</dependency>
```
-### Gradle
-Java 8:
-```
-'org.postgresql:postgresql:9.4.1211'
-```
-Java 7:
-```
-'org.postgresql:postgresql:9.4.1211.jre7'
-```
-Java 6:
-```
-'org.postgresql:postgresql:9.4.1211.jre6'
-```
-### Ivy
-Java 8:
-```xml
-<dependency org="org.postgresql" name="postgresql" rev="9.4.1211"/>
-```
-Java 7:
+
+[][mvn-jre7]
```xml
-<dependency org="org.postgresql" name="postgresql" rev="9.4.1211.jre7"/>
+<dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.4.1211.jre7</version>
+</dependency>
```
-Java 6:
+
+[][mvn-jre6]
```xml
-<dependency org="org.postgresql" name="postgresql" rev="9.4.1211.jre6"/>
+<dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>9.4.1211.jre6</version>
+</dependency>
```
+[mvn-search]: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.postgresql%22%20AND%20a%3A%22postgresql%22 "Search on Maven Central"
+[mvn-jre6]: http://search.maven.org/#artifactdetails|org.postgresql|postgresql|9.4.1211.jre6|bundle
+[mvn-jre7]: http://search.maven.org/#artifactdetails|org.postgresql|postgresql|9.4.1211.jre7|bundle
+[mvn-jre8]: http://search.maven.org/#artifactdetails|org.postgresql|postgresql|9.4.1211|bundle
-### Development snapshots
-
-Snapshot builds (builds from `master` branch) are deployed to Maven Central, so you can test current development version via
+#### Development snapshots
+Snapshot builds (builds from `master` branch) are also deployed to Maven Central, so you can test current development version (test some bugfix) using:
```xml
<dependency>
<groupId>org.postgresql</groupId>
@@ -99,313 +67,107 @@ Snapshot builds (builds from `master` branch) are deployed to Maven Central, so
</dependency>
```
-There are also available (snapshot) binary RPMs in Fedora's Copr repository, you
-can download them from:
-https://copr.fedorainfracloud.org/coprs/g/pgjdbc/pgjdbc-travis/
-
-
-## Build requirements
-
-In order to build the source code for PgJDBC you will need the following tools:
-
-- A git client
-- A recent version of Maven (3.x)
-- A JDK for the JDBC version you'd like to build (JDK6 for JDBC 4, JDK7 for JDBC 4.1 or JDK8 for JDBC 4.2)
-- A running PostgreSQL instance
-
-Additionally, in order to update translations (not typical), you will need the following additional tools:
-
-- the gettext package, which contains the commands "msgfmt", "msgmerge", and "xgettext"
-
-## Checking out the source code
-
-The PgJDBC project uses git for version control. You can check out the current code by running:
-
- git clone https://github.com/pgjdbc/pgjdbc.git
-
-This will create a pgjdbc directory containing the checked-out source code.
-In order do build jre7 or jre6 compatible versions, check out those repositories under `pgjdbc`
-
- cd pgjdbc # <-- that is pgjdbc/pgjdbc.git clone
- git clone https://github.com/pgjdbc/pgjdbc-jre7.git
- git clone https://github.com/pgjdbc/pgjdbc-jre6.git
-
-Note: all the source code is stored in `pgjdbc.git` repository, so just `pgjdbc.git` is sufficient for development.
-
-## Compiling with Maven on the command line
-
-After checking out the code you can compile and test the PgJDBC driver by running the following
-on a command line:
-
- mvn package
-
-Note: if you want to skip test execution, issue `mvn package -DskipTests`.
-
-Note: in certain cases, proper build requires cleaning the results of previous one.
-For instance, if you remove a `.java` file, then clean is required to remove the relevant `.class` file.
-In such cases, use `mvn clean` or `mvn clean package`.
-
-PgJDBC doesn't natively support building from IDEs like Eclipse, NetBeans or
-IntelliJ. However you can use the tools Maven support from within the IDE if you wish.
-You can use regular IDE tools to develop, execute tests, etc, however if you want to build final
-artifacts you should use `mvn`.
-
-After running the build , and build a .jar file (Java ARchive)
-depending on the version of java and which release you have the jar will be named
-postgresql-<major>.<minor>.<release>.jre<N>.jar. Where major,minor are the PostgreSQL major,minor
-version numbers. release is the jdbc release number. N is the version of the JDBC API which
-corresponds to the version of Java used to compile the driver.
-
-The target directory will contain the driver jar.
-If you need source code, documentation and runtime dependencies use `mvn package -P release-artifacts`.
-
-*NOTE*: default build produces Java 8 (JDBC 4.2) driver (in `pgjdbc/target` folder).
-
-If you need a version for older Java, configure `~/.m2/toolchains.xml`.
-Here's sample configuration for macOS:
-```xml
-<?xml version="1.0" encoding="UTF8"?>
-<toolchains>
- <!-- JDK toolchains -->
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>1.6</version>
- <vendor>oracle</vendor>
- </provides>
- <configuration>
- <jdkHome>/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home</jdkHome>
- </configuration>
- </toolchain>
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>1.7</version>
- <vendor>oracle</vendor>
- </provides>
- <configuration>
- <jdkHome>/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home</jdkHome>
- </configuration>
- </toolchain>
- <toolchain>
- <type>jdk</type>
- <provides>
- <version>1.8</version>
- <vendor>oracle</vendor>
- </provides>
- <configuration>
- <jdkHome>/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home</jdkHome>
- </configuration>
- </toolchain>
-</toolchains>
-```
-
-## Updating translations
-
-From time to time, the translation packages will need to be updated as part of the build process.
-However, this is atypical, and is generally only done when needed such as by a project committer before a major release.
-This process adds additional compile time and generally should not be executed for every build.
-
-Updating translations can be accomplished with the following command:
-
- mvn -Ptranslate compile && git add pgjdbc && git commit -m "Translations updated"
-
-Note that the maven profile "translate" can safely be called with other profiles, such as -P release-artifacts.
-Invocation of this command will generate new .po files, a new messages.pot file, and newly translated class files.
-
-## Releasing a snapshot version
-
-TravisCI automatically deploys snapshots for each commit to master branch.
-
-Git repository typically contains -SNAPSHOT versions, so you can use the following command:
-
- mvn deploy && (cd pgjdbc-jre7; mvn deploy) && (cd pgjdbc-jre6; mvn deploy)
-
-## Releasing a new version
-
-Prerequisites:
-- JDK 6, JDK 7, and JDK8 configured in `~/.m2/toolchains.xml`
-- a PostgreSQL instance for running tests
-- ensure that the RPM packaging CI isn't failing at
- [copr web page](https://copr.fedorainfracloud.org/coprs/g/pgjdbc/pgjdbc-travis/builds/) -
- possibly bump `parent poms` or `pgjdbc` versions in RPM [spec file](packaging/rpm/postgresql-jdbc.spec).
-
-Procedure:
+There are also available (snapshot) binary RPMs in [Fedora's Copr repository](https://copr.fedorainfracloud.org/coprs/g/pgjdbc/pgjdbc-travis/).
-Release a version for JDK8
-- From a root folder, perform `mvn release:clean release:prepare`. That will ask you new version, update pom.xml, commit and push it to git.
-- From a root folder, perform `mvn release:perform`. That will *stage* Java 8-compatible PgJDBC version to maven central.
-
-Release a version for JDK7
-- Update `pgjdbc` submodule in `pgjdbc-jre7`
-
-```
-cd pgjdbc-jre7/pgjdbc
-git checkout master
-git reset --hard REL9.4.1208
-cd ..
-git add pgjdbc
-git commit -m "Update pgjdbc"
-```
-
-- Release `pgjdbc-jre7`
-
-```
-mvn release:clean release:prepare release:perform
-```
-
-Release a version for JDK6
-- Update `pgjdbc` submodule in `pgjdbc-jre7`
-- Release `pgjdbc-jre6`
-
-```
-mvn release:clean release:prepare release:perform
-```
-
-Close staging repository and release it:
-- From a `pgjdbc` folder, perform
-
-```
-mvn nexus-staging:close -DstagingRepositoryId=orgpostgresql-1082
-```
-
-The staged repository will become open for smoke testing access at https://oss.sonatype.org/content/repositories/orgpostgresql-1082/
-
-If staged artifacts look fine, release it
-
-```
- mvn nexus-staging:release -DstagingRepositoryId=orgpostgresql-1082
-```
-
-Update changelog:
-- run `./release_notes.sh`, edit as desired
-
-## Dependencies
-
-PgJDBC has optional dependencies on other libraries for some features. These
-libraries must also be on your classpath if you wish to use those features; if
-they aren't, you'll get a `PSQLException` at runtime when you try to use features
-with missing libraries.
-
-Maven will download additional dependencies from the Internet (from Maven
-repositories) to satisfy build requirements. Whether or not you intend to use
-the optional features the libraries used to implement them they *must* be present to
-compile the driver.
-
-Currently Waffle-JNA and its dependencies are required for SSPI authentication
-support (only supported on a JVM running on Windows). Unless you're on Windows
-and using SSPI you can leave them out when you install the driver.
-
-## Installing the driver
-
-To install the driver, the postgresql jar file has to be in the classpath.
-When running standalone Java programs, use the `-cp` command line option,
-e.g.
-
- java -cp postgresql-<major>.<minor>.<release>.jre<N>.jar -jar myprogram.jar
+## Changelog
+Notable changes for:
-If you're using an application server or servlet container, follow the
-instructions for installing JDBC drivers for that server or container.
+**9.4.1211** (2016-09-18):
+* json type is returned as PGObject like in pre-9.4.1210 (fixed regression of 9.4.1210)
+* 'current transaction is aborted' exception includes the original exception via caused-by chain
-For users of IDEs like Eclipse, NetBeans, etc, you should simply add the
-driver JAR like any other JAR to use it in your program. To use it within
-the IDE itself (for database browsing etc) you should follow the IDE
-specific documentation on how to install JDBC drivers.
+**9.4.1210** (2016-09-07):
+* BUG: json datatype is returned as java.lang.String object, not as PGObject (fixed in 9.4.1211)
+* Better support for RETURN_GENERATED_KEYS, statements with RETURNING clause
+* Avoid user-visible prepared-statement errors if client uses DEALLOCATE/DISCARD statements (invalidate cache when those statements detected)
+* Avoid user-visible prepared-statement errors if client changes search_path (invalidate cache when set search_path detected)
+* Support comments when replacing {fn ...} JDBC syntax
+* Support for Types.REF_CURSOR
-## Using the driver
+**9.4.1209** (2016-07-15):
+* Many improvements to `insert into .. values(?,?)` => `insert .. values(?,?), (?,?)...` rewriter. Give it a try by using `reWriteBatchedInserts=true` connection property. 2-3x improvements for insert batch can be expected
+* Full test suite passes against PostgreSQL 9.6, and OpenJDK 9
+* Performance optimization for timestamps (~`TimeZone.getDefault` optimization)
+* Allow build-from-source on GNU/Linux without maven repositories, and add Fedora Copr test to the regression suite
-Java 6 and above do not need any special action to enable the driver - if it's
-on the classpath it is automatically detected and loaded by the JVM.
+Read the [History of Changes](https://jdbc.postgresql.org/documentation/changelog.html#introduction) for reference of previous versions.
-## JDBC URL syntax
+----------------------------------------------------
+## Documentation
+For more information you can read [the PgJDBC driver documentation](https://jdbc.postgresql.org/documentation/head/) or for general JDBC documentation please refer to [The Java™ Tutorials](http://docs.oracle.com/javase/tutorial/jdbc/).
+### Building the Connection URL
The driver recognises JDBC URLs of the form:
-
- jdbc:postgresql/
-
- jdbc:postgresql:database
-
- jdbc:postgresql://host/database
-
- jdbc:postgresql://host/
-
- jdbc:postgresql://host:port/database
-
- jdbc:postgresql://host:port/
-
-When the parameter `database` is omitted it defaults to the username.
-
-Also, you can supply both username and passwords as arguments, by appending
-them to the URL. e.g.:
-
- jdbc:postgresql:database?user=me
- jdbc:postgresql:database?user=me&password=mypass
-
-Notes:
-
-- If you are connecting to localhost or 127.0.0.1 you can leave it out of the
- URL. i.e.: `jdbc:postgresql://localhost/mydb` can be replaced with
- `jdbc:postgresql:mydb`
-
-- The port defaults to 5432 if it's left out.
-
-There are many options you can pass on the URL to control the driver's behaviour.
-See the full JDBC driver documentation for details.
-
-## More information
-
-For more information see the [the PgJDBC driver documentation](https://jdbc.postgresql.org/documentation/documentation.html) and [the JDBC tutorial](http://docs.oracle.com/javase/tutorial/jdbc/).
-
-## Bug reports, patches and development
-
-PgJDBC development is carried out on the [PgJDBC mailing list](https://jdbc.postgresql.org/community/mailinglist.html) and on [GitHub](https://github.com/pgjdbc/pgjdbc).
-
-Set of "backend protocol missing features" is collected in [backend_protocol_v4_wanted_features.md](backend_protocol_v4_wanted_features.md)
-
-### Bug reports
-
-For bug reports please post on pgsql-jdbc or add a GitHub issue. If you include
-additional unit tests demonstrating the issue, or self-contained runnable test
-case including SQL scripts etc that shows the problem, your report is likely to
-get more attention. Make sure you include appropriate details on your
-environment, like your JDK version, container/appserver if any, platform,
-PostgreSQL version, etc. Err on the site of excess detail if in doubt.
-
-### Bug fixes and new features
-
-If you've developed a patch you want to propose for inclusion in PgJDBC, feel
-free to send a GitHub pull request or post the patch on the PgJDBC mailing
-list. Make sure your patch includes additional unit tests demonstrating and
-testing any new features. In the case of bug fixes, where possible include a
-new unit test that failed before the fix and passes after it.
-
-For information on working with GitHub, see: http://help.github.com/articles/fork-a-repo and http://learn.github.com/p/intro.html.
-
-### Testing
-
-Remember to test proposed PgJDBC patches when running against older PostgreSQL
-versions where possible, not just against the PostgreSQL you use yourself.
-
-You also need to test your changes with older JDKs. PgJDBC must support JDK6
-("Java 1.6") and newer. Code that is specific to a particular spec version
-may use features from that version of the language. i.e. JDBC4.1 specific
-may use JDK7 features, JDBC4.2 may use JDK8 features.
-Common code and JDBC4 code needs to be compiled using JDK6.
-
-Three different versions of PgJDBC can be built, the JDBC 4, 4.1 and 4.2 drivers.
-These require JDK6, JDK7 and JDK8 respectively.
-The driver to build is auto-selected based on the JDK version used to run the
-build. The best way to test a proposed change is to build and test with JDK6, 7 and 8.
-
-You can get old JDK versions from the [Oracle Java Archive](http://www.oracle.com/technetwork/java/archive-139210.html).
-
-Then, to test against old JDK, run `mvn test` in `pgjdbc-jre6` or `pgjdbc-jre7` modules.
-
-For information about the unit tests and how to run them, see
- [org/postgresql/test/README](pgjdbc/src/test/java/org/postgresql/test/README.md)
-
-
+```
+jdbc:postgresql:database
+jdbc:postgresql:/
+jdbc:postgresql://host/database
+jdbc:postgresql://host/
+jdbc:postgresql://host:port/database
+jdbc:postgresql://host:port/
+```
+The general format for a JDBC URL for connecting to a PostgreSQL server is as follows, with items in square brackets ([ ]) being optional:
+```
+jdbc:postgresql://[host][:port][/[database]][?property1=value1[&property2=value2]...]
+```
+where:
+ * **jdbc:postgresql:** (Required) is known as the sub-protocol and is constant.
+ * **host** (Optional) is the server address to connect. This could be a DNS or IP address, or it could be *localhost* or *127.0.0.1* for the local computer. To specify an IPv6 address your must enclose the host parameter with square brackets (jdbc:postgresql://[::1]:5740/accounting). Defaults to `localhost`.
+ * **port** (Optional) is the port number listening on the host. Defaults to `5432`.
+ * **database** (Optional) is the database name. Defaults to the same name as the *user name* used in the connection.
+ * **propertyX** (Optional) is one or more option connection properties. For more information see *Connection properties*.
+
+#### Connection Properties
+In addition to the standard connection parameters the driver supports a number of additional properties which can be used to specify additional driver behaviour specific to PostgreSQL™. These properties may be specified in either the connection URL or an additional Properties object parameter to DriverManager.getConnection.
+
+| Property | Type | Default | Description |
+| ----------------------------- | ------- | :-----: | ------------- |
+| user | String | null | The database user on whose behalf the connection is being made. |
+| password | String | null | The database user's password. |
+| ssl | Boolean | false | Control use of SSL (true value causes SSL to be required) |
+| sslfactory | String | null | Provide a SSLSocketFactory class when using SSL. |
+| sslfactoryarg | String | null | Argument forwarded to constructor of SSLSocketFactory class. |
+| sslmode | String | null | Parameter governing the use of SSL. |
+| sslcert | String | null | The location of the client's SSL certificate |
+| sslkey | String | null | The location of the client's PKCS#8 SSL key |
+| sslrootcert | String | null | The location of the root certificate for authenticating the server. |
+| sslhostnameverifier | String | null | A class, implementing javax.net.ssl.HostnameVerifier that can verify the server |
+| sslpaswordcallback | String | null | A class, implementing javax.security.auth.callback.CallbackHandler that can handle PassworCallback for the ssl password. |
+| sslpassword | String | null | The password for the client's ssl key (ignored if sslpasswordcallback is set) |
+| sendBufferSize | Integer | -1 | Socket write buffer size |
+| recvBufferSize | Integer | -1 | Socket read buffer size |
+| loglevel | Integer | 0 | The log level to debug the driver, posible values: 0, 1, 2 |
+| allowEncodingChanges | Boolean | false | Allow for changes in client_encoding |
+| logUnclosedConnections | Boolean | false | When connections that are not explicitly closed are garbage collected, log the stacktrace from the opening of the connection to trace the leak source |
+| binaryTransferEnable | String | "" | Comma separated list of types to enable binary transfer. Either OID numbers or names |
+| binaryTransferDisable | String | "" | Comma separated list of types to disable binary transfer. Either OID numbers or names. Overrides values in the driver default set and values set with binaryTransferEnable. |
+| prepareThreshold | Integer | 5 | Statement prepare threshold. A value of -1 stands for forceBinary |
+| preparedStatementCacheQueries | Integer | 256 | Specifies the maximum number of entries in per-connection cache of prepared statements. A value of 0 disables the cache. |
+| preparedStatementCacheSizeMiB | Integer | 5 | Specifies the maximum size (in megabytes) of a per-connection prepared statement cache. A value of 0 disables the cache. |
+| defaultRowFetchSize | Integer | 0 | Positive number of rows that should be fetched from the database when more rows are needed for ResultSet by each fetch iteration |
+| loginTimeout | Integer | 0 | Specify how long to wait for establishment of a database connection.|
+| connectTimeout | Integer | 10 | The timeout value used for socket connect operations. |
+| socketTimeout | Integer | 0 | The timeout value used for socket read operations. |
+| tcpKeepAlive | Boolean | false | Enable or disable TCP keep-alive. |
+| ApplicationName | String | null | The application name (require server version >= 9.0) |
+| readOnly | Boolean | true | Puts this connection in read-only mode |
+| disableColumnSanitiser | Boolean | false | Enable optimization that disables column name sanitiser |
+| assumeMinServerVersion | String | null | Assume the server is at least that version |
+| currentSchema | String | null | Specify the schema to be set in the search-path |
+| targetServerType | String | any | Specifies what kind of server to connect, posible values: any, master, slave, preferSlave |
+| hostRecheckSeconds | Integer | 10 | Specifies period (seconds) after host statuses are checked again in case they have changed |
+| loadBalanceHosts | Boolean | false | If disabled hosts are connected in the given order. If enabled hosts are chosen randomly from the set of suitable candidates |
+| socketFactory | String | null | Specify a socket factory for socket creation |
+| socketFactoryArg | String | null | Argument forwarded to constructor of SocketFactory class. |
+| autosave | String | never | Specifies what the driver should do if a query fails, posible values: always, never, conservative |
+| preferQueryMode | String | extended | Specifies which mode is used to execute queries to database, posible values: extended, extendedForPrepared, extendedCacheEveryting, simple |
+| reWriteBatchedInserts | Boolean | false | Enable optimization to rewrite and collapse compatible INSERT statements that are batched. |
+
+## Contributing
+For information on how to contribute to the project see the [Contributing Guidelines](CONTRIBUTING.md)
+
+----------------------------------------------------
### Sponsors
-[PostgreSQL International](http://www.postgresintl.com)
-
+* [PostgreSQL International](http://www.postgresintl.com)
+* [YourKit](https://www.yourkit.com/)
[parent: 00a847879f31]