Re: Patch to allow setting schema/search_path in the connectionURL

From: Dave Cramer <davecramer(at)gmail(dot)com>
To: cowwoc <cowwoc(at)bbs(dot)darktech(dot)org>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Patch to allow setting schema/search_path in the connectionURL
Date: 2014-09-21 17:40:21
Message-ID: CADK3HH+8RRAbEjVMDe32+TuinTM=C1xWoRbhKnmGSNRjjTJN+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Yes it will work
On Sep 21, 2014 1:39 PM, "cowwoc" <cowwoc(at)bbs(dot)darktech(dot)org> wrote:

> I actually want the same user across all schemas (unit tests where each
> test runs against a different schema in order to isolate the tests from
> each other).
>
> Can someone please confirm whether set search_path can be set on a per
> connection basis?
>
> Thanks,
> Gili
> On Sep 21, 2014 10:50 AM, "Matheus de Oliveira [via PostgreSQL]" <[hidden
> email] <http://user/SendEmail.jtp?type=node&node=5819855&i=0>> wrote:
>
>>
>> On Thu, Sep 18, 2014 at 4:59 PM, John R Pierce <[hidden email]
>> <http://user/SendEmail.jtp?type=node&node=5819845&i=0>> wrote:
>>
>>> On 9/18/2014 12:47 PM, stagirus wrote:
>>>
>>>> Does anybody know of a solution on how to designate a schema while
>>>> establishing the connection? I would highly appreciate it!!!
>>>>
>>>>
>>>
>>> we use the rolename as the default schema. works for us.
>>
>>
>> If someone has this requirement, it *probably* uses different users for
>> different schema configurations. In such case you don't even need to match
>> user name and schema name, you can simple configure search_path per user as:
>>
>> ALTER ROLE username SET search_path TO schema1, schema2, ...;
>>
>> For me, setting search_path from URL connection is a mistake, as it is
>> not one of configurations accept on connection creating at the protocol (or
>> is it?), like it is for client_encoding, application_name and others. If
>> JDBC devs are going to change settings on URL then you probably should
>> start thinking on more generic, like setting any GUC (like work_mem, etc.).
>>
>> Disclaimer: I'm not a JDBC community active user, that is my "opinion",
>> and you can take or not... ;-)
>>
>> Regards,
>> --
>> Matheus de Oliveira
>> Analista de Banco de Dados
>> Dextra Sistemas - MPS.Br nível F!
>> www.dextra.com.br/postgres
>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://postgresql.1045698.n5.nabble.com/Patch-to-allow-setting-schema-search-path-in-the-connectionURL-tp2174512p5819845.html
>> To unsubscribe from Patch to allow setting schema/search_path in the
>> connectionURL, click here.
>> NAML
>> <http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
> ------------------------------
> View this message in context: Re: Patch to allow setting
> schema/search_path in the connectionURL
> <http://postgresql.1045698.n5.nabble.com/Patch-to-allow-setting-schema-search-path-in-the-connectionURL-tp2174512p5819855.html>
> Sent from the PostgreSQL - jdbc mailing list archive
> <http://postgresql.1045698.n5.nabble.com/PostgreSQL-jdbc-f2168246.html>
> at Nabble.com.
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alexis Meneses 2014-09-22 11:11:02 Re: Patch to allow setting schema/search_path in the connectionURL
Previous Message cowwoc 2014-09-21 17:38:13 Re: Patch to allow setting schema/search_path in the connectionURL