Message-ID: From: "cgm-aw (@cgm-aw)" To: "pgjdbc/pgjdbc" Date: Wed, 23 Apr 2025 12:15:13 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3606: fix: add support for multiple schemas via PgConnection.setSchema In-Reply-To: References: List-Id: X-GitHub-Author-Login: cgm-aw X-GitHub-Comment-Id: 2824090276 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3606 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3606#issuecomment-2824090276 Content-Type: text/plain; charset=utf-8 Ok, I changed `getSchema` to call `SHOW search_path`. I noticed this in a test case: Before (current_schema()): ``` execute("SET search_path TO \"$user\",public,schema2"); assertEquals(TestUtil.getUser(), conn.getSchema()); // Now fails ``` After (show search_path): ``` execute("SET search_path TO \"$user\",public,schema2"); assertEquals("\"$user\", public, schema2", conn.getSchema()); // OK ``` So this means that `current_schema()` resolves the schema `$user` to the respective user name, while `SHOW search_path` keeps the variable in its output. Since you would use the variable in the SET command, I guess this is fine. Let me know if the PR is ok now, then I will look forward to the release 😃