Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Fri, 05 Dec 2025 12:27:10 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #2932: Unable to set currentSchema via jdbc URL In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 3616705917 X-GitHub-Comment-Type: issue_comment X-GitHub-Edited-At: 2025-12-05T12:45:39Z X-GitHub-Issue: 2932 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/2932#issuecomment-3616705917 Content-Type: text/plain; charset=utf-8 ``` static final String DB_URL = "jdbc:postgresql://localhost:5432/test"; // TODO set DB URL here try (Connection connection = DriverManager.getConnection(DB_URL+"?currentSchema=foo", DB_USERNAME, DB_PASSWORD)) { try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery("select current_schema()" )) { resultSet.next(); System.out.println("Current schema: " + resultSet.getString(1)); // foo } } ``` prints `Current schema: foo`