Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 7B86A634327 for ; Tue, 17 Mar 2009 08:41:54 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 74801-01 for ; Tue, 17 Mar 2009 08:41:45 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by mail.postgresql.org (Postfix) with ESMTP id 99C93633A17 for ; Tue, 17 Mar 2009 08:41:52 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 5so1062148ywh.73 for ; Tue, 17 Mar 2009 04:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Z3eyvhM/rZghw+64YqU1wBr7v6xli9aye4aQ8rMb28k=; b=k3Vbh4xv14xtYmBgaMnwhR9qDnE0BJ9ei9v+Xw3vwFi6pUruXj/IfMrI9/3UkpacHG kmzqnX1JnwKSkkeJBeGxHsVPjotg16ClrkaMAfttTgcApymf0M3XqvGVVjCBMuXO+l+O jf9pkVflrInCvqru47bT170grR69AiBNgLExM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=opsLuD3Z9ixfK9k9jj8ys0XL+doi6aA9LVVdrX9XW5PJfv+MmHJW9aeg/utdL0wu8X qJsazP7ySurF6BXe14JmjBtqMaqIRzGg6PNeeHhLVtU2hn1htk5rFAOAm0Zk2PSl06HH WrHnsxutgq6ksG9zX4be7JgaY5rPyvGb9OIv8= MIME-Version: 1.0 Received: by 10.231.19.204 with SMTP id c12mr1321203ibb.39.1237290110823; Tue, 17 Mar 2009 04:41:50 -0700 (PDT) In-Reply-To: <49bf5e7f$0$1347$834e42db@reader.greatnowhere.com> References: <49b7bfef$0$1343$834e42db@reader.greatnowhere.com> <491f66a50903120342j67e87c7dob10cfdc23580c8f4@mail.gmail.com> <003001c9a315$a68a9330$f39fb990$@com> <200903121341.59498.cservin@cromagnon.com> <49bca9e8$0$1341$834e42db@reader.greatnowhere.com> <491f66a50903150409y648b448pc3825ef4fc1ed7e@mail.gmail.com> <49bcfe15$0$1344$834e42db@reader.greatnowhere.com> <49BDABC7.3030108@burntmail.com> <491f66a50903160257m3cd01c07v828a33fab173e775@mail.gmail.com> <49bf5e7f$0$1347$834e42db@reader.greatnowhere.com> Date: Tue, 17 Mar 2009 13:41:50 +0200 Message-ID: <331e40660903170441o2f52f36fpb18dcf94ff88d37a@mail.gmail.com> Subject: Re: Totally weird behaviour in org.postgresql.Driver From: =?KOI8-U?B?96bUwcymyiD0yc3eydvJzg==?= To: Peter Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=00221532cf6c8a2e8304654f0dc7 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.791 tagged_above=0 required=5 tests=AWL=0.790, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200903/88 X-Sequence-Number: 19418 --00221532cf6c8a2e8304654f0dc7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 2009/3/17 Peter > > So is there a way to associate user variable with Postgres connection that > can be picked up by SQL code running in that connection? Right now I can > only think of PlPerl function that caches user id in a global variable, but > am not sure about potential pitfalls of such setup... > You could use temporary table. E.g. create temporary table localdata(name, value) as select values('user', 'john'); This will be connection-scope. --00221532cf6c8a2e8304654f0dc7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

2009/3/17 Peter <peter@greatnowhere.com>

So is there a way to associate user variable with Postgres connection that<= br> can be picked up by SQL code running in that connection? Right now I can only think of PlPerl function that caches user id in a global variable, but=
am not sure about potential pitfalls of such setup...

You could use temporar= y table.
E.g. create temporary table localdata(name, value) as select va= lues('user', 'john');
This will be connection-scope.
--00221532cf6c8a2e8304654f0dc7--