pax_global_header00006660000000000000000000000064136170577240014526gustar00rootroot0000000000000052 comment=c81913658858c623ebc4582eb703c2d8e21212ee pgjdbc-REL42.2.10/000077500000000000000000000000001361705772400134705ustar00rootroot00000000000000pgjdbc-REL42.2.10/.editorconfig000066400000000000000000000002351361705772400161450ustar00rootroot00000000000000root = true [*] insert_final_newline = true [*.java] indent_style = space indent_size = 2 charset = utf-8 end_of_line = lf trim_trailing_whitespace = true pgjdbc-REL42.2.10/.gitattributes000066400000000000000000000002311361705772400163570ustar00rootroot00000000000000* text=auto *.java text *.md text *.sql text *.sh text eol=lf *.xml text *.yaml text *.yml text /CHANGELOG.md merge=union /contributors.json merge=union pgjdbc-REL42.2.10/.github/000077500000000000000000000000001361705772400150305ustar00rootroot00000000000000pgjdbc-REL42.2.10/.github/issue_template.md000066400000000000000000000012731361705772400204000ustar00rootroot00000000000000**I'm submitting a ...** - [ ] bug report - [ ] feature request **Describe the issue** A clear and concise description of what the issue is. **Driver Version?** **Java Version?** **OS Version?** **PostgreSQL Version?** **To Reproduce** Steps to reproduce the behaviour: **Expected behaviour** A clear and concise description of what you expected to happen. And what actually happens **Logs** If possible PostgreSQL logs surrounding the occurrence of the issue Additionally logs from the driver can be obtained adding ```java loggerLevel=TRACE&loggerFile=pgjdbc-trace.log ``` to the connection string pgjdbc-REL42.2.10/.github/pull_request_template.md000066400000000000000000000016001361705772400217660ustar00rootroot00000000000000### All Submissions: * [ ] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document? * [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change? ### New Feature Submissions: 1. [ ] Does your submission pass tests? 2. [ ] Does mvn checkstyle:check pass ? 3. [ ] Have you added your new test classes to an existing test suite in alphabetical order? ### Changes to Existing Features: * [ ] Does this break existing behaviour? If so please explain. * [ ] Have you added an explanation of what your changes do and why you'd like us to include them? * [ ] Have you written new tests for your core changes, as applicable? * [ ] Have you successfully run tests with your changes locally? pgjdbc-REL42.2.10/.gitignore000066400000000000000000000006251361705772400154630ustar00rootroot00000000000000.classpath .settings .project .checkstyle .DS_Store .externalToolBuilders build jars .*.swp nbproject .idea *.iml *.ipr *.iws *.local.properties *-dist.zip *.po.~*~ target/ pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup pom.xml.next release.properties dependency-reduced-pom.xml buildNumber.properties # Ignore folders used to build binaries for old Java /pgjdbc-jre6 /pgjdbc-jre7 /eclipsebin/ pgjdbc-REL42.2.10/.travis.yml000066400000000000000000000204351361705772400156050ustar00rootroot00000000000000sudo: false language: java dist: trusty branches: except: - /^tmp\/.*/ - /^REL.*/ stages: - name: test if: not branch =~ ^release\/.*$ - name: release # releases pgjdbc for Java 8 # It does set release tag and update pom.xml versions if: branch =~ ^release\/.*$ - name: release_prev # releases pgjdbc for Java 6, Java 7 # pgjdbc-jreX requires release pom.xml versions of the main project, so pgjdbc-jreX should be # released after the release of the main version, thus second stage if: branch =~ ^release\/.*$ before_script: - test $(grep "after_n_builds" codecov.yml | tr -d '[:space:]' | cut -d":" -f2) -eq $(grep -e "COVERAGE=Y$" .travis.yml | wc -l) || exit 1 - export PG_DATADIR="/etc/postgresql/${PG_VERSION}/main" - export PG_SLAVE1_DATADIR="/etc/postgresql/${PG_VERSION}/slave1" - export PG_SLAVE2_DATADIR="/etc/postgresql/${PG_VERSION}/slave2" - ./.travis/travis_install_postgres.sh - test "x$XA" == 'x' || ./.travis/travis_configure_xa.sh - test "x$REPLICATION" == 'x' || ./.travis/travis_configure_replication.sh - test "x$SSLTEST" == 'x' || ./.travis/travis_configure_ssl.sh - ./.travis/travis_start_postgres.sh - test "x$PG_VERSION" != 'xHEAD' || psql -U postgres -c "set password_encryption='scram-sha-256'; create user test with password 'test';" - test "x$PG_VERSION" = 'xHEAD' || psql -U postgres -c "create user test with password 'test';" - test "x$REPLICATION" == 'x' || psql -U postgres -c "alter user test with replication;" - psql -c 'create database test owner test;' -U postgres - test "x$SSLTEST" == 'x' || ./.travis/travis_ssl_users.sh - test "x$REPLICATION" == 'x' || ./.travis/travis_create_slaves.sh - if [[ $TRAVIS_BRANCH == release/* ]]; then echo "MAVEN_OPTS='-Xmx1g'" > ~/.mavenrc; else echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc; fi - test "x$PG_VERSION" == 'x' || test "x$NO_HSTORE" == 'xY' || psql test -c 'CREATE EXTENSION hstore;' -U postgres - test "x$PG_VERSION" == 'x' || test "x$CREATE_PLPGSQL" == 'x' || createlang -U postgres plpgsql test - test "x$PG_VERSION" == 'x' || test "x$PLPGSQL_EXTENSION" == 'x' || psql test -c 'CREATE EXTENSION IF NOT EXISTS plpgsql;' -U postgres env: global: - secure: "NI+aqwRLLVt2feJdk/2ZEZnsaPyu+vOx8MahVxjz0UUVvRHVqxM5O1M0R53NJfEeIjflOzgZJwRLqgyl6dkdfjytRhaHWGptQdehV4cwNb+4epnn8WlpRzMac65zTQqnbGVtw9jissDQv6/Zl/+D+DMcU65BbFZkix40whILXG0=" before_install: - ./.travis/travis_install_zulu.sh - test -z "${ZULU_JDK}" || export JDK${ZULU_JDK}_HOME=/usr/lib/jvm/zulu-${ZULU_JDK}-amd64 - unset _JAVA_OPTIONS # see https://github.com/travis-ci/travis-ci/issues/8408 script: # make sure previous build artifacts are not used for subsequent builds - rm -rf $HOME/.m2/repository/org/postgresql || true - test -d "${JDK6_HOME}" || export JDK6_HOME=$(jdk_switcher home openjdk6) - test -d "${JDK7_HOME}" || export JDK7_HOME=$(jdk_switcher home openjdk7) - test -d "${JDK8_HOME}" || export JDK8_HOME=$(jdk_switcher home oraclejdk8) - test -d "${JDK9_HOME}" || export JDK9_HOME=$(jdk_switcher home oraclejdk9) - test -d "${JDK9_HOME}" || export JDK9_HOME=$(jdk_switcher home oraclejdk8) # JDK9 missing on precise, fallback to JDK8 - envsubst < toolchains.xml > ~/.m2/toolchains.xml - test ${JDK} -eq 9 || jdk_switcher use oraclejdk8 # Run Maven with Java 8, build with Toolchains. - test -z "${ZULU_JDK}" || export TRAVIS_JDK_VERSION=zulujdk${ZULU_JDK} # trick codecov to use correct jdk version - if [[ $TRAVIS_BRANCH == release/* ]]; then .travis/travis_release.sh; else ./.travis/travis_build.sh; fi - ./.travis/travis_check_postgres_health.sh # To avoid useless S3 cache updates (https://github.com/travis-ci/travis-ci/issues/1441#issuecomment-67607074) #- mkdir /tmp/cache-trick #- mv $HOME/.m2/repository/org/postgresql /tmp/cache-trick/ before_cache: # No sense in caching current build artifacts - rm -rf $HOME/.m2/repository/org/postgresql - find $HOME/.ivy2 -name "ivydata-*.properties" -delete - find $HOME/.sbt -name "*.lock" -delete # Skip default "mvn install" issued by Travis # Root project cannot be compiled with older JDKs, so it makes sense to just skip the step install: true cache: directories: - $HOME/.m2/repository - $HOME/.ivy2/cache - $HOME/.sbt/boot/ matrix: fast_finish: true include: - stage: test jdk: oraclejdk8 env: RUN_CHECKSTYLE=true script: mvn checkstyle:check - env: - FEDORA_CI=Y services: - docker if: type != pull_request - jdk: openjdk-ea sudo: required addons: postgresql: "10" env: - PG_VERSION=10 - JDK=12 - TZ=America/New_York # flips between −05:00 and −04:00 - jdk: openjdk-ea sudo: required addons: postgresql: "11" env: - PG_VERSION=11 - XA=true - COVERAGE=Y - NO_HSTORE=Y - PLPGSQL_EXTENSION=Y - jdk: oraclejdk9 sudo: required addons: postgresql: "11" env: - PG_VERSION=11 - XA=true - COVERAGE=Y - NO_HSTORE=Y - PLPGSQL_EXTENSION=Y - JDK=9 - jdk: oraclejdk8 sudo: required addons: postgresql: "11" env: - PG_VERSION=11 - XA=true - COVERAGE=Y - NO_HSTORE=Y - PLPGSQL_EXTENSION=Y - JDK=8 - jdk: oraclejdk11 sudo: required addons: postgresql: "10" env: - PG_VERSION=10 - JDK=11 - TZ=America/New_York # flips between −05:00 and −04:00 - jdk: oraclejdk9 addons: postgresql: "9.6" env: - PG_VERSION=9.6 - JDK=9 - TZ=America/New_York # flips between −05:00 and −04:00 - jdk: oraclejdk8 sudo: required env: - PG_VERSION=HEAD - XA=true - REPLICATION=Y - COVERAGE=Y - TEST_CLIENTS=Y - TZ=Pacific/Chatham # flips between +12:45 and +13:45 - JDK=8 - jdk: oraclejdk8 sudo: required addons: postgresql: "9.6" env: - PG_VERSION=9.6 - ZULU_JDK=8 - XA=true - REPLICATION=Y - COVERAGE=Y - MCENTRAL=Y - JDOC=Y - jdk: oraclejdk8 sudo: required addons: postgresql: "9.5" env: - PG_VERSION=9.5 - XA=true - REPLICATION=Y - JDK=8 - jdk: oraclejdk8 addons: postgresql: "9.4" env: - PG_VERSION=9.4 - QUERY_MODE=extendedCacheEverything - COVERAGE=Y - TZ=Europe/Moscow # +03:00, no DST - JDK=8 - jdk: oraclejdk8 sudo: required addons: postgresql: "10" env: - PG_VERSION=10 - SSLTEST=Y - COVERAGE=Y - JDK=8 - jdk: openjdk7 sudo: required addons: postgresql: "9.2" env: - PG_VERSION=9.2 - ZULU_JDK=7 - MCENTRAL=Y - COVERAGE=Y - TZ=UTC - jdk: openjdk7 sudo: required addons: postgresql: "9.1" env: - PG_VERSION=9.1 - ZULU_JDK=6 - MCENTRAL=Y - jdk: oraclejdk8 sudo: required env: - PG_VERSION=8.4 - XA=true - COVERAGE=Y - NO_HSTORE=Y - CREATE_PLPGSQL=Y - jdk: oraclejdk8 addons: postgresql: "9.6" env: - PG_VERSION=9.6 - QUERY_MODE=simple - COVERAGE=Y - TEST_CLIENTS=Y - JDK=8 - jdk: oraclejdk8 addons: postgresql: "9.3" env: - PG_VERSION=9.3 - QUERY_MODE=extendedForPrepared - COVERAGE=Y - JDK=8 - jdk: oraclejdk8 addons: postgresql: "9.4" env: - PG_VERSION=9.4 - NO_WAFFLE_NO_OSGI=Y - JDK=8 - stage: release jdk: oraclejdk8 env: - PG_VERSION=9.6 - stage: release_prev jdk: openjdk7 sudo: required addons: postgresql: "9.2" env: - PG_VERSION=9.2 - ZULU_JDK=7 - stage: release_prev jdk: openjdk7 sudo: required addons: postgresql: "9.1" env: - PG_VERSION=9.1 - ZULU_JDK=6 # Deploy snapshots to Maven Central after_success: - "test $TRAVIS_PULL_REQUEST == 'false' && test $TRAVIS_BRANCH == 'master' && test $MCENTRAL == 'Y' && ./.travis/travis_deploy.sh" pgjdbc-REL42.2.10/.travis/000077500000000000000000000000001361705772400150565ustar00rootroot00000000000000pgjdbc-REL42.2.10/.travis/secrets.tar.gpg000066400000000000000000000312131361705772400200120ustar00rootroot00000000000000 * lK Crhx! };~  Wze;b5:&$ˌ5$ h1Q]F罗HΤpD1Ę(C::nޮ՘WX8p}Sݏw~8eI|軵85-%ʤQD?%0 /5!uwp ՗,{g,1PB?#uƳhw5Z§`wb GLcH5:{/s}fg*i?h ![ 5Omږw|9.5Dqd*kę1 5Vs7JU$g/{fiY""8ִ3N~ZLe!xOun ;ĥBuZԫ[RсWy @qMrڴ%JoՕwam1x-Cg׸B|GiLڇr3Ƿ{YҺIZ%XKE% B"Td>9H=J{+V1?C;(9jm~`Imd'i1d|E:_ NkÅ-( 9;L +d+Ocd.f_ν1#\TXАljcyZR~b*[y=z&Qb%"=3#?VZBǧ%׀Qï QGv\Vzqȁ)EoޤD˞@)T09ωg!o(6ZX=."("f\9 &99DEy䔉ˡ ˥EY4(3Gk-:$FR>,Λf! RA@GxxlF26TRdo6,4 zNԹO>$I&C3f&M~}$[qZNe_ֽeIAХ:9;f䢾".+!c87 :cSt1^jۊ?lS`K_! L2:.[>IXSzqXS/9]!j?z1:H|PuD3Lm+h(ڦDZr ${HGeK_vhzK^%|V[g/fՊ2 ;sG}׮/ c'YjEij=9$vOhWD:d6DCç5^(CՄ+P|_/fdnDxv1ͥ:]76~<MuQYx AcՆ/Ti]5K;ڨBm%^u\~Lw|9LπIr+2Œ}f$81MV*[ {aAeTSJ,-MSYJ`#4#ҕ썦AŽ~6f7%nSPkkn0t @TՔ2MtǏϾGU *+I#!G(Ŝ]$H$T#-Cs VjSkvT=>naM>] }шb3 qxM}\WyvaQ3d-<'3ȋܐ/)$=J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stdout: write error" # WA is taken from https://github.com/travis-ci/travis-ci/issues/4704#issuecomment-348435959 python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);' export PROJECT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[') export PARENT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.parent.version | grep -v '\[') export CHECK_PARENT_VERSION=$(mvn help:evaluate -Dexpression=project.parent.version -q -DforceStdout -f pgjdbc/pom.xml) # just make sure that pom.xml has the same value as pgjdbc/pom.xml test "$PARENT_VERSION" = "$CHECK_PARENT_VERSION" exec ./packaging/rpm_ci fi # Build project MVN_ARGS="clean package -B -V $MVN_CUSTOM_ARGS" MVN_PROFILES="release" if [[ "${NO_WAFFLE_NO_OSGI}" == *"Y"* ]]; then MVN_ARGS="$MVN_ARGS -DwaffleEnabled=false -DosgiEnabled=false -DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi" fi if [[ "x${QUERY_MODE}" == *"x"* ]]; then MVN_ARGS="$MVN_ARGS -DpreferQueryMode=$QUERY_MODE" fi if [[ "${COVERAGE}" == *"Y"* ]]; then MVN_PROFILES="$MVN_PROFILES,coverage" fi if [[ "${JDK}" == *"9"* ]]; then export MAVEN_SKIP_RC=true MVN_ARGS="$MVN_ARGS -Dcurrent.jdk=1.9 -Djavac.target=1.9" fi if [[ "$JDOC" == *"Y"* ]]; then # Build javadocs for Java 8 only mvn ${MVN_ARGS} -P ${MVN_PROFILES},release-artifacts elif [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]]; then git clone --depth=50 https://github.com/pgjdbc/pgjdbc-jre6.git pgjdbc-jre6 cd pgjdbc-jre6 mvn ${MVN_ARGS} -P ${MVN_PROFILES},skip-unzip-jdk elif [[ "${TRAVIS_JDK_VERSION}" == *"jdk7"* ]]; then git clone --depth=50 https://github.com/pgjdbc/pgjdbc-jre7.git pgjdbc-jre7 cd pgjdbc-jre7 mvn ${MVN_ARGS} -P ${MVN_PROFILES},skip-unzip-jdk else mvn ${MVN_ARGS} -P ${MVN_PROFILES} fi if [[ "${COVERAGE}" == "Y" ]]; then pip install --user codecov codecov fi # Run Scala-based and Clojure-based tests if [[ "${TEST_CLIENTS}" == *"Y" ]]; then # Pgjdbc should be in "local maven repository" so the clients can use it. Mvn commands above just package it. mvn -DskipTests install mkdir -p $HOME/.sbt/launchers/0.13.12 curl -L -o $HOME/.sbt/launchers/0.13.12/sbt-launch.jar http://dl.bintray.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.12/sbt-launch.jar PROJECT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[') cd test-anorm-sbt sed -i "s/\"org.postgresql\" % \"postgresql\" % \"[^\"]*\"/\"org.postgresql\" % \"postgresql\" % \"${PROJECT_VERSION}\"/" build.sbt sbt test cd .. # Uncomment when https://github.com/clojure/java.jdbc/pull/44 is merged in #git clone --depth=10 https://github.com/clojure/java.jdbc.git #cd java.jdbc #TEST_DBS=postgres TEST_POSTGRES_USER=test TEST_POSTGRES_DBNAME=test mvn test -Djava.jdbc.test.pgjdbc.version=$PROJECT_VERSION fi pgjdbc-REL42.2.10/.travis/travis_check_postgres_health.sh000077500000000000000000000015511361705772400233370ustar00rootroot00000000000000#!/usr/bin/env bash check_core_dump() { local command_to_find="find ${PG_DATADIR} -type f -iname core*" if [ ! -r "${PG_DATADIR}" ] then command_to_find="sudo ${command_to_find}" fi local status=0 while IFS= read -r core_dump_file do status=1 echo "Detected core dump: ${core_dump_file}" echo bt full | sudo gdb --quiet /usr/local/pgsql/bin/postgres "${core_dump_file}" done < <(${command_to_find}) return ${status} } print_logs() { local log_file if [[ "${PG_VERSION}" = "HEAD" ]] then log_file="/tmp/postgres.log" else log_file="/var/log/postgresql/postgresql-${PG_VERSION}-main.log" fi if [ -r "${log_file}" ] then cat "${log_file}" else sudo cat "${log_file}" fi } check_core_dump if [[ $? -ne 0 ]] then print_logs exit 1 fipgjdbc-REL42.2.10/.travis/travis_configure_replication.sh000077500000000000000000000017111361705772400233570ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e set_conf_property() { local key=${1} local value=${2} sudo sed -i -e "s/^#\?${key}.*/${key} = ${value}/g" ${PG_DATADIR}/postgresql.conf } if [ "${REPLICATION}" = "Y" ] then if [ "${PG_VERSION}" = "HEAD" ] then PG_VERSION="9.5" fi if (( $(echo "${PG_VERSION} >= 9.1" | bc -l))) then set_conf_property "max_wal_senders" "10" set_conf_property "wal_keep_segments" "10" set_conf_property "wal_sender_timeout" "5s" sudo sed -i -e 's/^#local\s\+replication\s\+postgres\s\+\(.*\)/local replication all \1/g' ${PG_DATADIR}/pg_hba.conf sudo sed -i -e 's/^#host\s\+replication\s\+postgres\s\+\(.*\)\s\+\(.*\)/host replication all \1 \2/g' ${PG_DATADIR}/pg_hba.conf if (( $(echo "${PG_VERSION} >= 9.4" | bc -l))) then set_conf_property "wal_level" "logical" set_conf_property "max_replication_slots" "10" fi fi fi pgjdbc-REL42.2.10/.travis/travis_configure_ssl.sh000077500000000000000000000022731361705772400216530ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e set_conf_property() { local key=${1} local value=${2} sudo sed -i -e "s/^#\?${key}.*/${key} = '\/etc\/postgresql\/${PG_VERSION}\/main\/${value}'/" /etc/postgresql/${PG_VERSION}/main/postgresql.conf } enable_ssl_property() { local property=${1} sed -i -e "s/^#${property}\(.*\)/${property}\1/" ssltest.properties } if [ -z "$PG_VERSION" ] then echo "env PG_VERSION is not defined"; else set_conf_property "ssl_cert_file" "server.crt" set_conf_property "ssl_key_file" "server.key" set_conf_property "ssl_ca_file" "root.crt" enable_ssl_property "enable_ssl_tests" PG_DATA_DIR="/etc/postgresql/${PG_VERSION}/main/" sudo cp certdir/server/pg_hba.conf "/etc/postgresql/${PG_VERSION}/main/pg_hba.conf" sudo cp certdir/server/root.crt "${PG_DATA_DIR}" sudo chmod 0600 "${PG_DATA_DIR}/root.crt" sudo chown postgres:postgres "${PG_DATA_DIR}/root.crt" sudo cp certdir/server/server.crt "${PG_DATA_DIR}" sudo chmod 0600 "${PG_DATA_DIR}/server.crt" sudo chown postgres:postgres "${PG_DATA_DIR}/server.crt" sudo cp certdir/server/server.key "${PG_DATA_DIR}" sudo chmod 0600 "${PG_DATA_DIR}/server.key" sudo chown postgres:postgres "${PG_DATA_DIR}/server.key" fi pgjdbc-REL42.2.10/.travis/travis_configure_xa.sh000077500000000000000000000002201361705772400214500ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e sudo sed -i -e 's/#max_prepared_transactions = 0/max_prepared_transactions = 64/g' ${PG_DATADIR}/postgresql.conf pgjdbc-REL42.2.10/.travis/travis_create_slaves.sh000077500000000000000000000057061361705772400216350ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e if [ -z "$PG_VERSION" ] then echo "env PG_VERSION not defined"; elif [ "x${PG_VERSION}" = "xHEAD" ] then PG_CTL="/usr/local/pgsql/bin/pg_ctl" PG_BASEBACKUP="/usr/local/pgsql/bin/pg_basebackup" else PG_CTL="/usr/lib/postgresql/${PG_VERSION}/bin/pg_ctl" PG_BASEBACKUP="/usr/lib/postgresql/${PG_VERSION}/bin/pg_basebackup" fi #Create Slave 1 sudo rm -rf ${PG_SLAVE1_DATADIR} sudo mkdir -p ${PG_SLAVE1_DATADIR} sudo chmod 700 ${PG_SLAVE1_DATADIR} sudo chown -R postgres:postgres ${PG_SLAVE1_DATADIR} sudo su postgres -c "$PG_BASEBACKUP -Upostgres -D ${PG_SLAVE1_DATADIR} -X stream -R" if [[ "x${PG_VERSION}" != "xHEAD" ]] then sudo su postgres -c "echo 'local all all trust' > ${PG_SLAVE1_DATADIR}/pg_hba.conf" sudo su postgres -c "echo 'host all all 127.0.0.1/32 trust' >> ${PG_SLAVE1_DATADIR}/pg_hba.conf" sudo su postgres -c "echo 'host all all ::1/128 trust' >> ${PG_SLAVE1_DATADIR}/pg_hba.conf" sudo su postgres -c "touch ${PG_SLAVE1_DATADIR}/pg_ident.conf" sudo su postgres -c "cp -f ${PG_DATADIR}/postgresql.conf ${PG_SLAVE1_DATADIR}/postgresql.conf" sudo sed -i -e "/^[ \t]*data_directory.*/d" ${PG_SLAVE1_DATADIR}/postgresql.conf sudo sed -i -e "/^[ \t]*hba_file.*/d" ${PG_SLAVE1_DATADIR}/postgresql.conf sudo sed -i -e "/^[ \t]*ident_file.*/d" ${PG_SLAVE1_DATADIR}/postgresql.conf sudo sed -i -e "s/^#\?hot_standby.*/hot_standby = on/g" ${PG_SLAVE1_DATADIR}/postgresql.conf fi #Start Slave 1 sudo su postgres -c "$PG_CTL -D ${PG_SLAVE1_DATADIR} -w -t 300 -c -o '-p 5433' -l /tmp/postgres_slave1.log start" || (sudo tail /tmp/postgres_slave1.log ; exit 1) sudo tail /tmp/postgres_slave1.log #Create Slave 2 sudo rm -rf ${PG_SLAVE2_DATADIR} sudo mkdir -p ${PG_SLAVE2_DATADIR} sudo chmod 700 ${PG_SLAVE2_DATADIR} sudo chown -R postgres:postgres ${PG_SLAVE2_DATADIR} sudo su postgres -c "$PG_BASEBACKUP -Upostgres -D ${PG_SLAVE2_DATADIR} -X stream -R" if [[ "x${PG_VERSION}" != "xHEAD" ]] then sudo su postgres -c "echo 'local all all trust' > ${PG_SLAVE2_DATADIR}/pg_hba.conf" sudo su postgres -c "echo 'host all all 127.0.0.1/32 trust' >> ${PG_SLAVE2_DATADIR}/pg_hba.conf" sudo su postgres -c "echo 'host all all ::1/128 trust' >> ${PG_SLAVE2_DATADIR}/pg_hba.conf" sudo su postgres -c "touch ${PG_SLAVE2_DATADIR}/pg_ident.conf" sudo su postgres -c "cp -f ${PG_DATADIR}/postgresql.conf ${PG_SLAVE2_DATADIR}/postgresql.conf" sudo sed -i -e "/^[ \t]*data_directory.*/d" ${PG_SLAVE2_DATADIR}/postgresql.conf sudo sed -i -e "/^[ \t]*hba_file.*/d" ${PG_SLAVE2_DATADIR}/postgresql.conf sudo sed -i -e "/^[ \t]*ident_file.*/d" ${PG_SLAVE2_DATADIR}/postgresql.conf sudo sed -i -e "s/^#\?hot_standby.*/hot_standby = on/g" ${PG_SLAVE2_DATADIR}/postgresql.conf fi #Start Slave 2 sudo su postgres -c "$PG_CTL -D ${PG_SLAVE2_DATADIR} -w -t 300 -c -o '-p 5434' -l /tmp/postgres_slave2.log start" || (sudo tail /tmp/postgres_slave2.log ; exit 1) sudo tail /tmp/postgres_slave2.log pgjdbc-REL42.2.10/.travis/travis_deploy.sh000077500000000000000000000010541361705772400203010ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e # Skip tests and checkstype to speed up snapshot deployment MVN_ARGS="clean deploy -B -V -DskipTests -Dcheckstyle.skip=true -Dskip.assembly=true --settings settings.xml" if [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]]; then cd pgjdbc-jre6 mvn ${MVN_ARGS} -P release-artifacts,release,skip-unzip-jdk elif [[ "${TRAVIS_JDK_VERSION}" == *"jdk7"* ]]; then cd pgjdbc-jre7 mvn ${MVN_ARGS} -P release-artifacts,release,skip-unzip-jdk else mvn ${MVN_ARGS} -P release-artifacts,release -Dskip.unzip-jdk-src=false fi pgjdbc-REL42.2.10/.travis/travis_install_head_postgres.sh000077500000000000000000000022241361705772400233620ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e sudo service postgresql stop sudo apt-get update -qq sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge sudo apt-get -y install libxml2 gdb if [[ -z ${POSTGRES_SOURCE_SHA} ]] then git clone --depth=1 https://github.com/postgres/postgres.git cd postgres else git clone https://github.com/postgres/postgres.git cd postgres git checkout ${POSTGRES_SOURCE_SHA} fi # Build PostgreSQL from source if [[ "${COMPILE_PG_WITH_DEBUG_FLAG}" == "Y" ]] then sudo ./configure --enable-debug --with-libxml CFLAGS="-ggdb" else sudo ./configure --with-libxml CFLAGS="-ggdb" fi sudo make && sudo make install sudo ln -sf /usr/local/pgsql/bin/psql /usr/bin/psql # Build contrib from source cd contrib sudo make all && sudo make install #Post compile actions LD_LIBRARY_PATH=/usr/local/pgsql/lib export LD_LIBRARY_PATH sudo /sbin/ldconfig /usr/local/pgsql/lib sudo rm -rf ${PG_DATADIR} sudo mkdir -p ${PG_DATADIR} sudo chmod 777 ${PG_DATADIR} sudo chown -R postgres:postgres ${PG_DATADIR} sudo su postgres -c "/usr/local/pgsql/bin/pg_ctl -D ${PG_DATADIR} -U postgres initdb" pgjdbc-REL42.2.10/.travis/travis_install_postgres.sh000077500000000000000000000027161361705772400224070ustar00rootroot00000000000000#!/usr/bin/env bash # Adapted from https://github.com/dockyard/reefpoints/blob/master/source/posts/2013-03-29-running-postgresql-9-2-on-travis-ci.md set -x -e if [ -z "$PG_VERSION" ] then echo "env PG_VERSION not define"; elif [ "${PG_VERSION}" = "HEAD" ] then ./.travis/travis_install_head_postgres.sh elif [ ! -d "${PG_DATADIR}" ] then sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge source /etc/lsb-release echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main ${PG_VERSION}" > pgdg.list sudo mv pgdg.list /etc/apt/sources.list.d/ wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install postgresql-${PG_VERSION} postgresql-contrib-${PG_VERSION} -qq sudo sh -c "echo 'local all postgres trust' > /etc/postgresql/${PG_VERSION}/main/pg_hba.conf" sudo sh -c "echo 'local all all trust' >> /etc/postgresql/${PG_VERSION}/main/pg_hba.conf" sudo sh -c "echo -n 'host all all 127.0.0.1/32 trust' >> /etc/postgresql/${PG_VERSION}/main/pg_hba.conf" if [ ${PG_VERSION} = '8.4' ] then sudo sed -i -e 's/port = 5433/port = 5432/g' /etc/postgresql/8.4/main/postgresql.conf fi sudo service postgresql restart ${PG_VERSION} sudo tail /var/log/postgresql/postgresql-${PG_VERSION}-main.log fipgjdbc-REL42.2.10/.travis/travis_install_zulu.sh000077500000000000000000000006121361705772400215310ustar00rootroot00000000000000#!/usr/bin/env bash set -o xtrace -o errexit if [[ "${TRAVIS_SUDO}" == "true" && -n "${ZULU_JDK}" ]] then # Install OpenJDK Zulu from repository sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x219BD9C9 sudo apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main' sudo apt-get update -qq && sudo apt-get install zulu-${ZULU_JDK} -y fi pgjdbc-REL42.2.10/.travis/travis_release.sh000077500000000000000000000064331361705772400204330ustar00rootroot00000000000000#!/usr/bin/env bash # Fail script on error set -e cd .travis mkdir secrets # GPG is required for artifact signing echo $SUPER_SECRET_KEY | gpg --passphrase-fd 0 secrets.tar.gpg mv secrets.tar secrets cd secrets tar xvf secrets.tar gpg --import gpg-secret.key gpg --import-ownertrust gpg-ownertrust # Decrypt GitHub SSH key chmod 600 github_deploy eval $(ssh-agent -s) ssh-add ./github_deploy cd .. rm -rf ./secrets cd .. git config --global user.name "pgjdbc CI" git config --global user.email "pgsql-jdbc@postgresql.org" # By default Travis checks out commit, and maven-release-plugin wants to know branch name # On top of that, maven-release-plugin publishes branch, and it would terminate Travis job (current one!), # so we checkout a non-existing branch, so it won't get published # Note: at the end, we need to update "master" branch accordingly" (see $ORIGINAL_BRANCH) TMP_BRANCH=tmp/$TRAVIS_BRANCH CURRENT_VERSION=$(mvn -B -N org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -v '\[') RELEASE_VERSION=${CURRENT_VERSION/-SNAPSHOT} ORIGINAL_BRANCH=${TRAVIS_BRANCH#release/} REPO=$TRAVIS_REPO_SLUG JRE= if [[ "${TRAVIS_JDK_VERSION}" == *"jdk7"* ]]; then JRE=-jre7 elif [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]]; then JRE=-jre6 fi # Remove tmp branch if exists git push git@github.com:$TRAVIS_REPO_SLUG$JRE.git ":$TMP_BRANCH" || true set -x RELEASE_TAG=REL$RELEASE_VERSION if [[ "x$JRE" == "x" ]]; then # Note: release should be a fast-forward for the "master" branch # If push dry-run fails, the script just terminates git push --dry-run git@github.com:$TRAVIS_REPO_SLUG.git "HEAD:$ORIGINAL_BRANCH" git checkout -b "$TMP_BRANCH" else git fetch --unshallow # Use RELx.y.z.jreN RELEASE_TAG=$RELEASE_TAG.${JRE#-} # The following updates pgjdbc submodule of pgjdbc-jreX to the relevant RELx.y.z release tag git clone -b "$ORIGINAL_BRANCH" --depth=50 https://github.com/$TRAVIS_REPO_SLUG$JRE.git pgjdbc$JRE cd pgjdbc$JRE # Use tmp branch for the release, so mvn release would use that git checkout -b "$TMP_BRANCH" git submodule update --init # Force relevant version for jreN repository mvn -DnewVersion=$RELEASE_VERSION.${JRE#-}-SNAPSHOT versions:set versions:commit # Add all known pom.xml files in the repository git add -u \*pom.xml cd pgjdbc git fetch git checkout "$ORIGINAL_BRANCH" git reset --hard REL$RELEASE_VERSION cd .. git add pgjdbc git commit -m "Update pgjdbc to $RELEASE_VERSION" # Note: we are IN pgjdbc-jreX sub-folder, and the subsequent release would release "jre-specific" version fi # Remove release tag if exists just in case git push git@github.com:$TRAVIS_REPO_SLUG$JRE.git :$RELEASE_TAG || true # -Darguments here is for maven-release-plugin MVN_SETTINGS=$(pwd)/settings.xml mvn -B --settings settings.xml -Darguments="--settings '${MVN_SETTINGS}' -Dskip.unzip-jdk-src=false" -Dskip.unzip-jdk-src=false release:prepare release:perform -Darguments=-Dgpg.passphrase=$GPG_PASSPHRASE # Point "master" branch to "next development snapshot commit" git push git@github.com:$TRAVIS_REPO_SLUG$JRE.git "HEAD:$ORIGINAL_BRANCH" # Removal of the temporary branch is a separate command, so it left behind for the analysis in case "push to master" fails git push git@github.com:$TRAVIS_REPO_SLUG$JRE.git ":$TMP_BRANCH" pgjdbc-REL42.2.10/.travis/travis_ssl_users.sh000077500000000000000000000004331361705772400210270ustar00rootroot00000000000000#!/usr/bin/env bash create_databases() { for db in hostdb hostssldb hostnossldb certdb hostsslcertdb; do createdb -U postgres $db psql -U postgres $db -c "create extension sslinfo" done } create_databases psql -U postgres test -c "create extension sslinfo"pgjdbc-REL42.2.10/.travis/travis_start_postgres.sh000077500000000000000000000010551361705772400220710ustar00rootroot00000000000000#!/usr/bin/env bash set -x -e if [ -z "$PG_VERSION" ] then echo "env PG_VERSION not define"; elif [ "x${PG_VERSION}" = "xHEAD" ] then #Start head postgres sudo su postgres -c "/usr/local/pgsql/bin/pg_ctl -D ${PG_DATADIR} -w -t 300 -c -o '-p 5432' -l /tmp/postgres.log start" sudo tail /tmp/postgres.log elif [ "$XA" = "true" ] || [ "${REPLICATION}" = "Y" ] || [ "${SSLTEST}" = "Y" ] then sudo service postgresql stop sudo service postgresql start ${PG_VERSION} sudo tail /var/log/postgresql/postgresql-${PG_VERSION}-main.log fi pgjdbc-REL42.2.10/CHANGELOG.md000066400000000000000000000526411361705772400153110ustar00rootroot00000000000000# Changelog Notable changes since version 42.0.0, read the complete [History of Changes](https://jdbc.postgresql.org/documentation/changelog.html). The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ## [Unreleased] ## [42.2.10] (2020-01-30) ### Changed ### Added - Add maxResultBuffer property (#1657) - add caller push of binary data (rebase of #953) (#1659) ### Fixed - Cleanup PGProperty, sort values, and add some missing to docs (#1686) - Fixing LocalTime rounding (losing precision) (#1570) - Network Performance of PgDatabaseMetaData.getTypeInfo() method (#1668) - Issue #1680 updating a boolean field requires special handling to set it to t or f instead of true or false (#1682) - bug in pgstream for replication (#1681) - Issue #1677 NumberFormatException when fetching PGInterval with small value (#1678) - Metadata queries improvements with large schemas. (#1673) - Utf 8 encoding optimizations (#1444) - interval overflow (#1658) - Issue #1482 where the port was being added to the GSSAPI service name (#1651) - remove receiving EOF from backend after cancel since according to protocol the server closes the connection once cancel is sent (connection reset exception is always thrown) (#1641) - Unable to register out parameter Issue #1646 (#1648) ## [42.2.9] (2019-12-06) ### Changed ### Added - read only transactions [PR 1252](https://github.com/pgjdbc/pgjdbc/pull/1252) - pkcs12 key functionality [PR 1599](https://github.com/pgjdbc/pgjdbc/pull/1599) - new "escapeSyntaxCallMode" connection property [PR 1560](https://github.com/pgjdbc/pgjdbc/pull/1560) - connection property to limit server error detail in exception exceptions [PR 1579](https://github.com/pgjdbc/pgjdbc/pull/1579) - cancelQuery() to PGConnection public interface [PR 1157](https://github.com/pgjdbc/pgjdbc/pull/1157) - support for large update counts (JDBC 4.2) [PR 935](https://github.com/pgjdbc/pgjdbc/pull/935) - Add Binary Support for Oid.NUMERIC and Oid.NUMERIC_ARRAY [PR 1636](https://github.com/pgjdbc/pgjdbc/pull/1636) ### Fixed - issue 716 getTypeInfo() may not return data in the order specified in Oracle documentation [PR 1506](https://github.com/pgjdbc/pgjdbc/pull/1506) - PgSQLXML setCharacterStream() results in null value [PR 1608](https://github.com/pgjdbc/pgjdbc/pull/1608) - get correct column length for simple domains [PR 1605](https://github.com/pgjdbc/pgjdbc/pull/1605) - NPE as a result of calling executeQuery twice on a statement fixes issue [#684](https://github.com/pgjdbc/pgjdbc/issues/684) [PR 1610] (https://github.com/pgjdbc/pgjdbc/pull/1610) - handle numeric domain types [PR 1611](https://github.com/pgjdbc/pgjdbc/pull/1611) - pginterval to take iso8601 strings [PR 1612](https://github.com/pgjdbc/pgjdbc/pull/1612) - remove currentTimeMillis from code, tests are OK [PR 1617](https://github.com/pgjdbc/pgjdbc/pull/1617) - NPE when calling setNull on a PreparedStatement with no parameters [PR 1620](https://github.com/pgjdbc/pgjdbc/pull/1620) - allow OUT parameter registration when using CallableStatement native CALL [PR 1561](https://github.com/pgjdbc/pgjdbc/pull/1561) - add release save point into execute with batch [PR 1583](https://github.com/pgjdbc/pgjdbc/pull/1583) - Prevent use of extended query protocol for BEGIN before COPY [PR 1639](https://github.com/pgjdbc/pgjdbc/pull/1639) ## [42.2.8] (2019-09-13) ### Changed ### Added ### Fixed * fix: Revert inet default Java type to PGObject and handle values with net masks [PR 1568](https://github.com/pgjdbc/pgjdbc/pull/1568) ## [42.2.7] (2019-09-03) ### Changed ### Added - Expose parameter status messages (GUC_REPORT) to the user [PR 1435](https://github.com/pgjdbc/pgjdbc/pull/1435) - Add automatic module name to manifest for jdk9+ [PR 1538](https://github.com/pgjdbc/pgjdbc/pull/1538) - Log ignoring rollback when no transaction in progress [PR 1549](https://github.com/pgjdbc/pgjdbc/pull/1549) - Map inet type to InetAddress [PR 1527](https://github.com/pgjdbc/pgjdbc/pull/1527) [issue 1134](https://github.com/pgjdbc/pgjdbc/issues/1134) ### Fixed - fix [issue 1547](https://github.com/pgjdbc/pgjdbc/issues/1547) As long as peek returns some bytes do not reset the timeout, this allows us to continue checking until any async notifies are consumed [PR 1548](https://github.com/pgjdbc/pgjdbc/pull/1548) - fix: [issue 1466](https://github.com/pgjdbc/pgjdbc/issues/1466) In logical decoding the if the backend was requesting a reply we… [PR 1467](https://github.com/pgjdbc/pgjdbc/pull/1467) - fix: [issue 1534](https://github.com/pgjdbc/pgjdbc/issues/1534) Proleptic java.time support [PR 1539](https://github.com/pgjdbc/pgjdbc/pull/1539) - fix Ensure isValid() will not last more than timeout seconds [PR 1557](https://github.com/pgjdbc/pgjdbc/pull/1557) ## [42.2.6] (2019-06-19) ### Known issues - Waffle has [dropped support](https://github.com/Waffle/waffle/releases/tag/waffle-1.9.0) for 1.6, 1.7 as such the new waffle 1.9.x is only available in jre8 - Microseconds in timestamps might be truncated when transferred in binary mode - 24:00 time handling is not consistent [issue 1385](https://github.com/pgjdbc/pgjdbc/issues/1385) - Unexpected packet type during stream replication [issue 1466](https://github.com/pgjdbc/pgjdbc/issues/1466) - Driver goes missing after OSGi bundle restart [issue 1476](https://github.com/pgjdbc/pgjdbc/issues/1476) ### Changed - Change IS_GENERATED to IS_GENERATEDCOLUMN as per spec [PR 1485](https://github.com/pgjdbc/pgjdbc/pull/1485) - Fix missing metadata columns, and misspelled columns in PgDatabaseMetaData#getTables [PR 1323](https://github.com/pgjdbc/pgjdbc/pull/1323) ### Added - CI tests with Java 11, and Java EA - Support temporary replication slots in ReplicationCreateSlotBuilder [PR 1306](https://github.com/pgjdbc/pgjdbc/pull/1306) - Support PostgreSQL 11, 12 - Return function (PostgreSQL 11) columns in PgDatabaseMetaData#getFunctionColumns - Return information on create replication slot, now the snapshot_name is exported to allow a consistent snapshot in some uses cases. [PR 1335](https://github.com/pgjdbc/pgjdbc/pull/1335) ### Fixed - Fixed async copy performance (1ms per op) in SSL mode [PR 1314](https://github.com/pgjdbc/pgjdbc/pull/1314) - Return Double.NaN for 'NaN'::numeric [PR 1304](https://github.com/pgjdbc/pgjdbc/pull/1304) - Performance issue in PgDatabaseMetaData#getTypeInfo with lots of types in DB [PR 1302](https://github.com/pgjdbc/pgjdbc/pull/1302) - PGCopyInputStream#read should cap values to [0, 255], -1 [PR 1349](https://github.com/pgjdbc/pgjdbc/pull/1349) - Fixes LocalDateTime handling of BC dates [PR 1388](https://github.com/pgjdbc/pgjdbc/pull/1388) - Release savepoints in autosave mode to prevent out of shared memory errors at the server side [PR 1409](https://github.com/pgjdbc/pgjdbc/pull/1409) - Fix execution with big decimal in simple query mode. [PR 1463](https://github.com/pgjdbc/pgjdbc/pull/1463) - Fix rounding for timestamps truncated to dates before 1970 [PR 1502](https://github.com/pgjdbc/pgjdbc/pull/1502) ## [42.2.5] (2018-08-27) ### Known issues - 1ms per async copy call [issue 1312](https://github.com/pgjdbc/pgjdbc/issues/1312) ### Changed - `ssl=true` implies `sslmode=verify-full`, that is it requires valid server certificate [cdeeaca4](https://github.com/pgjdbc/pgjdbc/commit/cdeeaca47dc3bc6f727c79a582c9e4123099526e) ### Added - Support for `sslmode=allow/prefer/require` [cdeeaca4](https://github.com/pgjdbc/pgjdbc/commit/cdeeaca47dc3bc6f727c79a582c9e4123099526e) ### Fixed - Security: added server hostname verification for non-default SSL factories in `sslmode=verify-full` (CVE-2018-10936) [cdeeaca4](https://github.com/pgjdbc/pgjdbc/commit/cdeeaca47dc3bc6f727c79a582c9e4123099526e) - Updated documentation on SSL configuration [fa032732](https://github.com/pgjdbc/pgjdbc/commit/fa032732acfe51c6e663ee646dd5c1beaa1af857) - Updated Japanese translations [PR 1275](https://github.com/pgjdbc/pgjdbc/pull/1275) - IndexOutOfBounds on prepared multistatement with insert values [c2885dd0](https://github.com/pgjdbc/pgjdbc/commit/c2885dd0cfc793f81e5dd3ed2300bb32476eb14a) ## [42.2.4] (2018-07-14) ### Changed - PreparedStatement.setNull(int parameterIndex, int t, String typeName) no longer ignores the typeName argument if it is not null [PR 1160](https://github.com/pgjdbc/pgjdbc/pull/1160) ### Fixed - Fix treatment of SQL_TSI_YEAR, SQL_TSI_WEEK, SQL_TSI_MINUTE [PR 1250](https://github.com/pgjdbc/pgjdbc/pull/1250) - Map integrity constraint violation to XA_RBINTEGRITY instead of XAER_RMFAIL [PR 1175](https://github.com/pgjdbc/pgjdbc/pull/1175) [f2d1352c](https://github.com/pgjdbc/pgjdbc/commit/f2d1352c2b3ea98492beb6127cd6d95039a0b92f) ## [42.2.3] (2018-07-12) ### Known issues - SQL_TSI_YEAR is treated as hour, SQL_TSI_WEEK is treated as hour, SQL_TSI_MINUTE is treated as second ### Changed - Reduce the severity of the error log messages when an exception is re-thrown. The error will be thrown to caller to be dealt with so no need to log at this verbosity by pgjdbc [PR 1187](https://github.com/pgjdbc/pgjdbc/pull/1187) - Deprecate Fastpath API [PR 903](https://github.com/pgjdbc/pgjdbc/pull/903) - Support parenthesis in {oj ...} JDBC escape syntax [PR 1204](https://github.com/pgjdbc/pgjdbc/pull/1204) - ubenchmark module moved pgjdbc/benchmarks repository due to licensing issues [PR 1215](https://github.com/pgjdbc/pgjdbc/pull/1215) - Include section on how to submit a bug report in CONTRIBUTING.md [PR 951](https://github.com/pgjdbc/pgjdbc/pull/951) ### Fixed - getString for PGObject-based types returned "null" string instead of null [PR 1154](https://github.com/pgjdbc/pgjdbc/pull/1154) - Field metadata cache can be disabled via databaseMetadataCacheFields=0 [PR 1052](https://github.com/pgjdbc/pgjdbc/pull/1052) - Properly encode special symbols in passwords in BaseDataSource [PR 1201](https://github.com/pgjdbc/pgjdbc/pull/1201) - Adjust date, hour, minute, second when rounding nanosecond part of a timestamp [PR 1212](https://github.com/pgjdbc/pgjdbc/pull/1212) - perf: reduce memory allocations in query cache [PR 1227](https://github.com/pgjdbc/pgjdbc/pull/1227) - perf: reduce memory allocations in SQL parser [PR 1230](https://github.com/pgjdbc/pgjdbc/pull/1230), [PR 1233](https://github.com/pgjdbc/pgjdbc/pull/1233) - Encode URL parameters in BaseDataSource [PR 1201](https://github.com/pgjdbc/pgjdbc/pull/1201) - Improve JavaDoc formatting [PR 1236](https://github.com/pgjdbc/pgjdbc/pull/1236) ## [42.2.2] (2018-03-15) ### Added - Documentation on server-side prepared statements [PR 1135](https://github.com/pgjdbc/pgjdbc/pull/1135) ### Fixed - Avoid failure for `insert ... on conflict...update` for `reWriteBatchedInserts=true` case [PR 1130](https://github.com/pgjdbc/pgjdbc/pull/1130) - fix: allowEncodingChanges should allow set client_encoding=... [PR 1125](https://github.com/pgjdbc/pgjdbc/pull/1125) - Wrong data from Blob/Clob when mark/reset is used [PR 971](https://github.com/pgjdbc/pgjdbc/pull/971) - Adjust XAException return codes for better compatibility with XA specification [PR 782](https://github.com/pgjdbc/pgjdbc/pull/782) - Wrong results when single statement is used with different bind types[PR 1137](https://github.com/pgjdbc/pgjdbc/pull/1137) - Support generated keys for WITH queries that miss RETURNING [PR 1138](https://github.com/pgjdbc/pgjdbc/pull/1138) - Support generated keys when INSERT/UPDATE/DELETE keyword is followed by a comment [PR 1138](https://github.com/pgjdbc/pgjdbc/pull/1138) ## [42.2.1] (2018-01-25) ### Known issues - client_encoding has to be UTF8 even with allowEncodingChanges=true ### Changed - socksProxyHost is ignored in case it contains empty string [PR 1079](https://github.com/pgjdbc/pgjdbc/pull/1079) ### Fixed - Avoid connection failure when `DateStyle` is set to `ISO` (~PgBouncer) [Issue 1080](https://github.com/pgjdbc/pgjdbc/issues/1080) - Package scram:client classes, so SCRAM works when using a shaded jar [PR 1091](https://github.com/pgjdbc/pgjdbc/pull/1091) [1a89290e](https://github.com/pgjdbc/pgjdbc/commit/1a89290e110d5863b35e0a2ccf79e4292c1056f8) - reWriteBatchedInserts=true causes syntax error with ON CONFLICT [Issue 1045](https://github.com/pgjdbc/pgjdbc/issues/1045) [PR 1082](https://github.com/pgjdbc/pgjdbc/pull/1082) - Avoid failure in getPGArrayType when stringType=unspecified [PR 1036](https://github.com/pgjdbc/pgjdbc/pull/1036) - For PostgreSQL 9.0+ return a complete list of keywords in DatabaseMetadata.getSQLKeywords() from pg_catalog.pg_get_keywords(). [PR 940](https://github.com/pgjdbc/pgjdbc/pull/940) ## [42.2.0] (2018-01-17) ### Known issues - SCRAM does not work as scram:client library is not packaged - client_encoding has to be UTF8 even with allowEncodingChanges=true ### Added - Support SCRAM-SHA-256 for PostgreSQL 10 in the JDBC 4.2 version (Java 8+) using the Ongres SCRAM library. [PR 842](https://github.com/pgjdbc/pgjdbc/pull/842) - Make SELECT INTO and CREATE TABLE AS return row counts to the client in their command tags. [Issue 958](https://github.com/pgjdbc/pgjdbc/issues/958) [PR 962](https://github.com/pgjdbc/pgjdbc/pull/962) - Support Subject Alternative Names for SSL connections. [PR 952](https://github.com/pgjdbc/pgjdbc/pull/952) - Support isAutoIncrement metadata for PostgreSQL 10 IDENTITY column. [PR 1004](https://github.com/pgjdbc/pgjdbc/pull/1004) - Support for primitive arrays [PR#887](https://github.com/pgjdbc/pgjdbc/pull/887) [3e0491a](https://github.com/pgjdbc/pgjdbc/commit/3e0491ac3833800721b98e7437635cf6ab338162) - Implement support for get/setNetworkTimeout() in connections. [PR 849](https://github.com/pgjdbc/pgjdbc/pull/849) - Make GSS JAAS login optional, add an option "jaasLogin" [PR 922](https://github.com/pgjdbc/pgjdbc/pull/922) see [Connecting to the Database](https://jdbc.postgresql.org/documentation/head/connect.html) ### Changed - Improve behaviour of ResultSet.getObject(int, Class). [PR 932](https://github.com/pgjdbc/pgjdbc/pull/932) - Parse CommandComplete message using a regular expresion, allows complete catch of server returned commands for INSERT, UPDATE, DELETE, SELECT, FETCH, MOVE, COPY and future commands. [PR 962](https://github.com/pgjdbc/pgjdbc/pull/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](https://github.com/pgjdbc/pgjdbc/pull/1053) - Change behaviour of multihost connection. The new behaviour is to try all secondaries first before trying the master [PR 844](https://github.com/pgjdbc/pgjdbc/pull/844). - Avoid reflective access to TimeZone.defaultTimeZone in Java 9+ [PR 1002](https://github.com/pgjdbc/pgjdbc/pull/1002) fixes [Issue 986](https://github.com/pgjdbc/pgjdbc/issues/986) ### Fixed - 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](https://github.com/pgjdbc/pgjdbc/pull/857) - Use 00:00:00 and 24:00:00 for LocalTime.MIN/MAX. [PR 992](https://github.com/pgjdbc/pgjdbc/pull/992) - Now the DatabaseMetaData.getFunctions() implementation complies with the JDBC docs. [PR 918](https://github.com/pgjdbc/pgjdbc/pull/918) - Execute autosave/rollback savepoint via simple queries always to prevent "statement S_xx not exists" when autosaving fixes [Issue #955](https://github.com/pgjdbc/pgjdbc/issues/955) - Received resultset tuples, but no field structure for them" when bind failure happens on 5th execution of a statement [Issue 811](https://github.com/pgjdbc/pgjdbc/issues/811) ### Removed - Drop support for the (insecure) crypt authentication method. [PR 1026](https://github.com/pgjdbc/pgjdbc/pull/1026) ### Deprecated - Reintroduce Driver.getVersion for backward compatibility reasons, mark it as deprecated as application should not rely on it (regression since 42.0.0) [50d5dd3e](https://github.com/pgjdbc/pgjdbc/commit/50d5dd3e708a92602e04d6b4aa0822ad3f110a78) ## [42.1.4] (2017-08-01) ### Changed - Statements with non-zero fetchSize no longer require server-side named handle. This might cause issues when using old PostgreSQL versions (pre-8.4)+fetchSize+interleaved ResultSet processing combo. [Issue 869](https://github.com/pgjdbc/pgjdbc/issues/869) ## [42.1.3] (2017-07-14) ### Fixed - Fix NPE in PreparedStatement.executeBatch in case of empty batch (regression since 42.1.2). [PR 867](https://github.com/pgjdbc/pgjdbc/pull/867) ## [42.1.2] (2017-07-12) ### Changed - Better logic for *returning* keyword detection. Previously, pgjdbc could be defeated by column names that contain *returning*, so pgjdbc failed to "return generated keys" as it considered statement as already having *returning* keyword [PR 824](https://github.com/pgjdbc/pgjdbc/pull/824) [201daf1d](https://github.com/pgjdbc/pgjdbc/commit/201daf1dc916bbc35e2bbec961aebfd1b1e30bfc) - Use server-prepared statements for batch inserts when prepareThreshold>0. Note: this enables batch to use server-prepared from the first *executeBatch()* execution (previously it waited for *prepareThreshold* *executeBatch()* calls) [abc3d9d7](https://github.com/pgjdbc/pgjdbc/commit/abc3d9d7f34a001322fbbe53f25d5e77a33a667f) ### Fixed - Replication API: fix issue in #834 setting statusIntervalUpdate causes high CPU load. [PR 835](https://github.com/pgjdbc/pgjdbc/pull/835) [59236b74](https://github.com/pgjdbc/pgjdbc/commit/59236b74acdd400d9d91d3eb2bb07d70b15392e5) ### Regresions - NPE in PreparedStatement.executeBatch in case of empty batch. Fixed in 42.1.3 ## [42.1.1] (2017-05-05) ### Fixed - Fix infinite dates that might be corrupted when transferred in binary for certain JREs. For instance, 5881610-07-11 instead of infinity. [1e5bf563](https://github.com/pgjdbc/pgjdbc/commit/1e5bf563f41203417281117ed20b183cd295b4e0) ## [42.1.0] (2017-05-04) ### Added - Support fetching a REF_CURSOR using getObject [PR 809](https://github.com/pgjdbc/pgjdbc/pull/809) ### Fixed - Fix data being truncated in setCharacterStream (bug introduced in 42.0.0) [PR 802](https://github.com/pgjdbc/pgjdbc/pull/802) - Fix calculation of lastReceiveLSN for logical replication [PR 801](https://github.com/pgjdbc/pgjdbc/pull/801) - Make sure org.postgresql.Driver is loaded when accessing though DataSource interface [Issue 768](https://github.com/pgjdbc/pgjdbc/issues/768) ### Regressions - There's no 42.1.0.jre6 version due to infinity handling bug. Fixed in 42.1.1.jre6 ## [42.0.0] (2017-02-20) ### Added - Replication protocol API was added: [replication API documentation](https://jdbc.postgresql.org//documentation/head/replication.html). [PR 550](https://github.com/pgjdbc/pgjdbc/pull/550) - java.util.logging is now used for logging: [logging documentation](https://jdbc.postgresql.org//documentation/head/logging.html). [PR 722](https://github.com/pgjdbc/pgjdbc/pull/722) - Add support for PreparedStatement.setCharacterStream(int, Reader). [ee4c4265](https://github.com/pgjdbc/pgjdbc/commit/ee4c4265aebc1c73a1d1fabac5ba259d1fbfd1e4) ### Changed - Version bumped to 42.0.0 to avoid version clash with PostgreSQL version and follow a better sematic versioning. [46634923](https://github.com/pgjdbc/pgjdbc/commit/466349236622c6b03bb9cd8d7f517c3ce0586751) - Ensure executeBatch() can be used with pgbouncer. Previously pgjdbc could use server-prepared statements for batch execution even with prepareThreshold=0. [Issue 742](https://github.com/pgjdbc/pgjdbc/issues/742) - Error position is displayed when SQL has unterminated literals, comments, etc. [Issue 688](https://github.com/pgjdbc/pgjdbc/issues/688) - Strict handling of accepted values in getBoolean and setObject(BOOLEAN), now it follows PostgreSQL accepted values, only 1 and 0 for numeric types are accepted (previously !=0 was true). [PR 732](https://github.com/pgjdbc/pgjdbc/pull/732) - Return correct versions and name of the driver. [PR 668](https://github.com/pgjdbc/pgjdbc/pull/668) ### Removed - Support for PostgreSQL versions below 8.2 was dropped. [PR 661](https://github.com/pgjdbc/pgjdbc/pull/661) ### Deprecated - Deprecated PGPoolingDataSource, instead of this class you should use a fully featured connection pool like HikariCP, vibur-dbcp, commons-dbcp, c3p0, etc. [PR 739](https://github.com/pgjdbc/pgjdbc/pull/739) ### Regressions - Data truncated in setCharacterStream. Fixed in 42.1.0 - No suitable driver found for jdbc:postgresql when using a DataSource implementation. Fixed in 42.1.0 [42.0.0]: https://github.com/pgjdbc/pgjdbc/compare/REL9.4.1212...REL42.0.0 [42.1.0]: https://github.com/pgjdbc/pgjdbc/compare/REL42.0.0...REL42.1.0 [42.1.1]: https://github.com/pgjdbc/pgjdbc/compare/REL42.1.0...REL42.1.1 [42.1.2]: https://github.com/pgjdbc/pgjdbc/compare/REL42.1.1...REL42.1.2 [42.1.3]: https://github.com/pgjdbc/pgjdbc/compare/REL42.1.2...REL42.1.3 [42.1.4]: https://github.com/pgjdbc/pgjdbc/compare/REL42.1.3...REL42.1.4 [42.2.0]: https://github.com/pgjdbc/pgjdbc/compare/REL42.1.4...REL42.2.0 [42.2.1]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.0...REL42.2.1 [42.2.2]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.1...REL42.2.2 [42.2.3]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.2...REL42.2.3 [42.2.4]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.3...REL42.2.4 [42.2.5]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.4...REL42.2.5 [42.2.6]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.5...REL42.2.6 [42.2.7]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.6...REL42.2.7 [42.2.8]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.7...REL42.2.8 [42.2.9]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.8...REL42.2.9 [Unreleased]: https://github.com/pgjdbc/pgjdbc/compare/REL42.2.9...HEAD pgjdbc-REL42.2.10/CONTRIBUTING.md000066400000000000000000000514721361705772400157320ustar00rootroot00000000000000# Guidelines for Contributing Thank you so much for wanting to contribute to **PostgreSQL JDBC Driver**! The purpose of the *Guidelines for Contributing* is to create a collaboration baseline. **Do NOT** blindly obey these guidelines, use them (after understanding) where they make sense. Currently the PgJDBC driver supports the Oracle and OpenJDK Java implementations of versions **6**, **7**, **8** and **9**; and PostgreSQL server versions from **8.2** and higher. Some PostgreSQL forks *might* work but are not officially supported, we support vendors of forks that want to improve this driver by sending us pull requests that are not disruptive to the community ecosystem of PostgreSQL. ## Issues Issues are a great way to keep track of tasks, enhancements, and bugs for the PgJDBC project. ### How to submit a bug report If you find a bug in the PgJDBC driver please use an issue to report it, try to be concise and detailed in your report, please ensure to specify at least the following: * Use a concise subject. * PgJDBC driver version (e.g. 42.0.0.jre7) * JDK/JRE version or the output of `java -version` (e.g. OpenJDK Java 8u144, Oracle Java 7u79) * PostgreSQL server version or the output of `select version()` (e.g. PostgreSQL 9.6.2) * Context information: what you were trying to achieve with PgJDBC. * Simplest possible steps to reproduce * More complex the steps are, lower the priority will be. * A pull request with failing JUnit test case is most preferred, although it's OK to paste the test case into the issue description. You can consider a bug: some behaviour that worked before and now it does not; a violation of the JDBC spec in any form, unless it's stated otherwise as an extension. In the unlikely event that a breaking change is introduced in the driver we will update the major version. We will document this change but please read carefully the changelog and test thoroughly for any potential problems with your app. What is not acceptable is to introduce breaking changes in the minor or patch update of the driver, If you find a regression in a minor patch update, please report an issue. Bug reports are not isolated only to code, errors in documentation as well as the website source code located in the **docs** directory also qualify. You are welcome to report issues and send a pull request on these as well. [skip ci] can be added to the commit message to prevent Travis-CI from building a pull request that only changes the documentation. For enhancements request keep reading the *Ideas, enhancements and new features* seccion. ### Ideas, enhancements and new features If you have ideas or proposed changes, please post on the [mailing list](https://www.postgresql.org/list/pgsql-jdbc/) or open a detailed, specific [GitHub issue](https://github.com/pgjdbc/pgjdbc/issues/new). Think about how the change would affect other users, what side effects it might have, how practical it is to implement, what implications it would have for standards compliance and security, etc. Include a detailed use-case description. Few of the PgJDBC developers have spare time, so it's unlikely that your idea will be picked up and implemented for you. The best way to make sure a 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. ## Contributing code Here are a few important things you should know about contributing code: 1. API changes require discussion, use cases, etc. Code comes later. 2. Pull requests are great for small fixes for bugs, documentation, etc. 3. Pull request needs to be approved and merged by maintainers into the master branch. 4. Pull requests needs to fully pass CI tests. ### 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 (optional for unit/integration tests) 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" ### Hacking on PgJDBC 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` ```bash 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-...[jre].jar. We use Semantic versioning; as such major, minor, patch refer to the level of change introduced. For Java 6, and Java 7 jre will be appended after the patch level. N corresponds to the version of Java, roughly correlated to the JDBC version number. 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 jdk 1.6 oracle /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home jdk 1.7 oracle /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home jdk 1.8 oracle /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home ``` ## Checkstyle We enforce a style using checkstyle, Travis CI will fail if there are checkstyle errors. It is recommended you run mvn checkstyle:check before creating your pull request ​ ## 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; it must have a user named `test` as well as a database named `test` - 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). ### Release via Travis To release a branch via Travis, perform the following: TL;DR: git checkout -B release/master origin/master git push origin release/master 1. Check if `pom.xml` includes proper `-SNAPSHOT` versions (release versions would be the ones without `-SNAPSHOT`) 1. Push `release/master` branch to pointing to the commit you want to release. Note: `master..release/master` should be a fast-forward or both branches should point to the same commit. Travis would build new version, create a tag, update `pom.xml` to the next snapshot versions, and update `master` branch accordingly. Note: .jre6 and .jre7 builds will be built and staged to Maven Central automatically Note: the artifacts will not be visible in Maven Central before you manually release them. 1. Navigate to [Sonatype Nexus Repository Manager](https://oss.sonatype.org/#stagingRepositories), find staging `orgpostgresql` repository there and release it ### Manual release 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 ``` ### Updating 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-...jre.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: https://guides.github.com/activities/forking/ and https://guides.github.com/introduction/flow/. ### 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. An easy way to set up the test PostgreSQL database is to use [jackdb/pgjdbc-test-vm](https://github.com/jackdb/pgjdbc-test-vm). Follow the instructions on that project's [README](https://github.com/jackdb/pgjdbc-test-vm) page. For more information about the unit tests and how to run them, see [TESTING.md](TESTING.md) ## Support for IDEs It's possible to debug and test PgJDBC with various IDEs, not just with mvn on the command line. Projects aren't supplied, but it's easy to prepare them. ### IntelliJ IDEA IDEA imports PgJDBC project just fine. So clone the project whatever way you like and import it (e.g. File -> Open -> `pom.xml`) * Configure code style: Project code style is located at `pgjdbc/src/main/checkstyle/pgjdbc-intellij-java-google-style.xml` In order to import it, copy the file to `$IDEA_CONFIG_LOCATION/codestyles` folder, restart IDEA, then choose "GoogleStyle (PgJDBC)" style for the Preferences -> Editor -> CodeStyle setting. For instance, for macOS it would be `~/Library/Preferences/IntelliJIdeaXX/codestyles`. More details here: https://intellij-support.jetbrains.com/hc/en-us/articles/206827437-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs ### Eclipse On Eclipse Mars, to import PgJDBC as an Eclipse Java project with full support for on-demand compile, debugging, etc, you can use the following approach: * File -> New -> Project * Maven -> Check out Maven Project from SCM * Pick `git`, select `https://github.com/pgjdbc/pgjdbc.git` URL. Note: if `git` SCM is missing, just click `m2e Marketplace` link and search for `egit` there. Note the letter `e`. * Click finish * Eclipse might complain with "Plugin execution not covered by lifecycle configuration: com.igormaznitsa:jcp:6.0.1:preprocess (execution: preprocessSources, phase: generate-sources)", however this error seems to be not that important Configure format configuration: * Import "import order" configuration: Eclipse -> Preferences -> Java -> Java Code Style -> Organize Imports -> Import... -> `.../workspace-pgjdbc/pgjdbc-aggregate/pgjdbc/src/main/checkstyle/pgjdbc_eclipse.importorder` * Import "formatter" configuration: Eclipse -> Preferences -> Java -> Java Code Style -> Formatter -> Import... -> `.../workspace-pgjdbc/pgjdbc-aggregate/pgjdbc/src/main/checkstyle/pgjdbc-eclipse-java-google-style.xml` * Configure "trim trailing whitespace": Eclipse -> Preferences -> Java -> Editor -> Save Actions -> "Perform Selected actions on save": * Check "Format source code", "Format edited lines" * Keep "Optimize Imports" selected * Check "Additional actions", click "Configure" * Click "Remove trailing whitespace", all lines * On "Code Style" tab, check "Use blocks in if/while/... statements", "Always" * On "Missing Code" tab, uncheck "Add missing @Override annotation" * On "Unnecessary Code" tab, check "Remove unused imports" Eclipse will interoperate fine with Maven, so you can test and debug with Eclipse then do dist builds with Maven. ### Other IDEs Please submit build instructions for your preferred IDE. ## Coding Guidelines ### Java Project uses [Google style](https://google.github.io/styleguide/javaguide.html) conventions for java with 100 wide lines. Code style is verified via Travis job. In order to do manual verification, issue cd pgjdbc && mvn checkstyle:check Use 2 spaces for indenting, do not use tabs, trim space at end of lines. Always put braces, even for single-line `if`. Always put `default:` case for `switch` statement. Note: there are formatter configurations in `pgjdbc/src/main/checkstyle` folder. ### Test General rule: failing test should look like a good bug report. Thus `Assert.fail()` is bad. * Consider using "single assertion" per test method. Having separate test methods helps manual execution of the tests, and it makes test report cleaner * Consider using `assertEquals(String message, expected, actual)` instead of `assertTrue(expected == actual)`. The former allows you to provide human readable message and it integrates well with IDEs (i.e. it allows to open diff of expected and actual). If using just `assertTrue(expected == actual)` all you get is a stacktrace and if such a test fails a developer has to reverse engineer the intention behind that code. ## Git Commit Guidelines We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. But also, we use the git commit messages to **generate the change log**. ### Commit Message Format Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, and a **subject**: ``` :