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 1j055N-0001fQ-HC for pgsql-jdbc@arkaria.postgresql.org; Fri, 07 Feb 2020 14:58:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j055K-0002te-7D for pgsql-jdbc@arkaria.postgresql.org; Fri, 07 Feb 2020 14:58:22 +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 1j055J-0002tW-QJ for pgsql-jdbc@lists.postgresql.org; Fri, 07 Feb 2020 14:58:22 +0000 Received: from out-24.smtp.github.com ([192.30.252.207]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j055D-000373-1o for pgsql-jdbc@lists.postgresql.org; Fri, 07 Feb 2020 14:58:20 +0000 Received: from github-lowworker-292e294.va3-iad.github.net (github-lowworker-292e294.va3-iad.github.net [10.48.102.70]) by smtp.github.com (Postfix) with ESMTP id 0924B6A112D for ; Fri, 7 Feb 2020 06:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1581087494; bh=fNmB336U7RhqvQWSi8sY+Uw/CpEKknUkIXTbLWTlYwU=; h=Date:From:To:Subject:From; b=DYP9/eqLt29/iiI3oF1xZ8h6X4fMzXlpRFpZ82JjLfCKX2bkI9Q8aCb9tjly9Zz8X Q4/7H7wpt+LN5gNEyFgcXApegf2Hzkndt7ZvwW3zmiW5Ca8K4h3Xi/sc03gNfl56Qo eeq7alFd0HweBJJfaPI+iop3Gp8UF5QwvQy7OugE= Date: Fri, 07 Feb 2020 06:58:13 -0800 From: Mike Goodman To: pgsql-jdbc@lists.postgresql.org Message-ID: Subject: [pgjdbc/pgjdbc] cc31c1: refactor: make PSQLState enum consts for integrity... 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: cc31c13f7810e171c54729a29f494d69b7f1550a https://github.com/pgjdbc/pgjdbc/commit/cc31c13f7810e171c54729a29f494d69b7f1550a Author: Mike Goodman Date: 2020-02-07 (Fri, 07 Feb 2020) Changed paths: M pgjdbc/src/main/java/org/postgresql/util/PSQLState.java M pgjdbc/src/test/java/org/postgresql/test/core/LogServerMessagePropertyTest.java M pgjdbc/src/test/java/org/postgresql/test/jdbc2/ServerErrorTest.java Log Message: ----------- refactor: make PSQLState enum consts for integrity constraint violations (#1699) * refactor: make PSQLState enum consts for integrity constraint violations Previously the PSQLState enum did not include values for any of the integrity constraint violation error codes mentioned in the PostgreSQL docs (as seen under Class 25 here: https://www.postgresql.org/docs/current/errcodes-appendix.html); this required hardcoding or the creation of consts wherever they were needed (as seen in LogServerMessagePropertyTest.java). This commit adds all of them (except restrict_violation which doesn't seem to appear in the wild) and creates a test checking for each of them.