pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: davecramer (@davecramer) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3606: fix: add support for multiple schemas via PgConnection.setSchema
Date: Thu, 17 Apr 2025 13:26:15 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

> I'm happy to change it, but this would alter the behavior of the method and might break existing code. Maybe rather update the documentation, that `getSchema()` returns the results of `current_schema()`, which shows the first element on the search_path? I guess this is up to you to decide; personally, I would not change `getSchema()`. Obviously setting a list of schemas is an edge case, since I'm the first to report it. If I connect with psql and just run `show search_path` I get this:
> 
> ```
> postgres=# show search_path;
>    search_path   
> -----------------
>  "$user", public
> (1 row)
> 
> postgres=# select current_schema();
>  current_schema 
> ----------------
>  public
> (1 row)
> ```
> 
> I'm out of my depth here, but it seems like the schema `"$user"` is hidden from `current_schema()`. I never heard of this $user schema, so I cannot really explain what is going on.

FYI `If one of the list items is the special name $user, then the schema having the name returned by CURRENT_USER is substituted, if there is such a schema and the user has USAGE permission for it. (If not, $user is ignored.)`

but in regards to getSchema, currently `getSchema()` returns whatever schema was set in `setSchema()`

In a way this patch breaks that

view thread (19+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #3606: fix: add support for multiple schemas via PgConnection.setSchema
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox