Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjNbE-0005nD-8b for pgsql-jdbc@arkaria.postgresql.org; Fri, 05 Jul 2019 12:46:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hjNbD-0002as-3a for pgsql-jdbc@arkaria.postgresql.org; Fri, 05 Jul 2019 12:45:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjNbC-0002Yv-IQ for pgsql-jdbc@lists.postgresql.org; Fri, 05 Jul 2019 12:45:58 +0000 Received: from out-19.smtp.github.com ([192.30.252.202]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hjNai-0004vi-2z for pgsql-jdbc@lists.postgresql.org; Fri, 05 Jul 2019 12:45:56 +0000 Date: Fri, 05 Jul 2019 05:45:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1562330726; bh=zOk/DbYt8pe37p+L5yarrBik1fRnGFAQWK64Mh3ggG0=; h=Date:From:To:Subject:From; b=i6WRVycwoYOc60f3iBB3vGM8evxgn6huyuBOsKYfdZqpZEK4P59X+7NYr6nRoKUeO iwecRr+2c7asTtV96/XX8V6uvfiO+qH3j/ReU2cwI5Jb2x9/RGYlsWGqIE03GUYvrQ Xz+wpPn5DU6VTw9g81PIdPLW6HAleI9CVJwwBeK0= From: Craig Ringer To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] ce8333: Expose parameter status messages (GUC_REPORT) to t... Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Approved: 58GruLoMopuc X-GitHub-Recipient-Address: pgsql-jdbc@lists.postgresql.org X-Auto-Response-Suppress: All List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Branch: refs/heads/master Home: https://github.com/pgjdbc/pgjdbc Commit: ce8333a56ba74022adeb545b68e7d2bee32d966f https://github.com/pgjdbc/pgjdbc/commit/ce8333a56ba74022adeb545b68e7d2bee32d966f Author: Craig Ringer Date: 2019-07-05 (Fri, 05 Jul 2019) Changed paths: M docs/documentation/head/ext.md A docs/documentation/head/parameterstatus.md M docs/documentation/head/replication.md M docs/documentation/head/server-prepare.md M pgjdbc/src/main/java/org/postgresql/PGConnection.java M pgjdbc/src/main/java/org/postgresql/core/QueryExecutor.java M pgjdbc/src/main/java/org/postgresql/core/QueryExecutorBase.java M pgjdbc/src/main/java/org/postgresql/core/v3/QueryExecutorImpl.java M pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java M pgjdbc/src/test/java/org/postgresql/test/jdbc2/Jdbc2TestSuite.java A pgjdbc/src/test/java/org/postgresql/test/jdbc2/ParameterStatusTest.java M pgjdbc/src/test/java/org/postgresql/test/jdbc2/StatementTest.java Log Message: ----------- Expose parameter status messages (GUC_REPORT) to the user (#1435) * Expose parameter status messages (GUC_REPORT) to the user Add a new `Map PGConnection.getParameterStatuses()` method that tracks the latest values of all `GUC_REPORT` parameters reported by the server in `ParameterStatus` protocol messages from the server. The map is read-only. A convenience `PGConnection.getParameterStatus(String)` wrapper is also provided. This provides a PgJDBC equivalent to the `PQparameterStatus(...)` `libpq` API function. Extensions may define custom GUCs that are set as `GUC_REPORT` when they `DefineCustomStringVariable(...)` etc. This feature will properly handle such GUCs, allowing applications to generate parameter status change messages in their extensions and have them available to the JDBC driver without needing round trips. No assumptions are made about which server GUCs are `GUC_REPORT` or their names, so it'll work (with possible test case tweaks) on current and future server versions. Github issue pgjdbc/pgjdbc#1428 * Attempt to make StatementTest.testShortQueryTimeout() more reliable I'm observing intermittent failures like: testShortQueryTimeout(org.postgresql.test.jdbc2.StatementTest) Time elapsed: 0.219 sec <<< ERROR! org.postgresql.util.PSQLException: ERROR: canceling statement due to user request The cause of that isn't yet clear. But I noticed that the test doesn't check for the SQLSTATE of the expected exception, so fix that.