pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: JUNG, Christian <christian.jung@saarstahl.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PATCH: SET ROLE as connection parameter
Date: Thu, 3 Sep 2009 20:49:49 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.0909031941040.19087@leary.csoft.net> (raw)
In-Reply-To: <24BB5F92CE3E62419C5A6D5B1A1E0F46028E1B1C@nts58.saarstahl.de>
References: <24BB5F92CE3E62419C5A6D5B1A1E0F46028E1AF1@nts58.saarstahl.de>
	<alpine.BSO.2.00.0909021224540.28438@leary.csoft.net>
	<24BB5F92CE3E62419C5A6D5B1A1E0F46028E1B1C@nts58.saarstahl.de>



On Thu, 3 Sep 2009, JUNG, Christian wrote:

> sendStartupPacket by
>> adding it to the params array?  If so that would save a network
>> -----Original Message-----
>> 1) Can this be done in the V3 ConnectionFactoryImpl's
> roundtrip
>> per connection that used this option.
>
> I'm afraid that setting the role in the startup packet won't work. It's
> only possible to change the role if the connection is in transaction
> state (as far as I understand the GUC stuff in the backend code
> correctly).

Hmm, it looks like this works on CVS HEAD, but not before that.  It must 
be related to the removal of flatfiles.c.  We can't make any version 
specific decisions prior to establishing a connection, so we can't do it 
in the startup packet, but I think it should still be in the 
ConnectionFactory code.  For the V2 Protocol it can be done in the 
existing network trip done by runInitialQueries.

> Should the options be stored in a HashMap and the user be allowed to set
> any key-/value-pair (no check if keys are allowed/mistyped, easy to use
> new features) or should there be dedicated getter/setter (new features
> have to be coded)?

The previous discussion was that this wouldn't work for Datasources which 
have to be accessed in a Java-Bean(y) way, so they can only take simply 
parameters, not a Map.  So I'd just do role and search_path for the moment 
because we don't have any good ideas on how a general solution would work.

Kris Jurka



view thread (5+ messages)

Message-ID: <alpine.BSO.2.00.0909031941040.19087@leary.csoft.net>
Permalink:  ../alpine.BSO.2.00.0909031941040.19087@leary.csoft.net/
Also on:    postgresql.org/message-id/alpine.BSO.2.00.0909031941040.19087@leary.csoft.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, christian.jung@saarstahl.com
  Subject: Re: PATCH: SET ROLE as connection parameter
  In-Reply-To: <alpine.BSO.2.00.0909031941040.19087@leary.csoft.net>
  References: <24BB5F92CE3E62419C5A6D5B1A1E0F46028E1AF1@nts58.saarstahl.de> <alpine.BSO.2.00.0909021224540.28438@leary.csoft.net> <24BB5F92CE3E62419C5A6D5B1A1E0F46028E1B1C@nts58.saarstahl.de> <alpine.BSO.2.00.0909031941040.19087@leary.csoft.net>

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

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