X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id D7B9F9FA2AD for ; Mon, 11 Sep 2006 07:32:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 38335-02 for ; Mon, 11 Sep 2006 10:31:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id DAD7C9FA231 for ; Mon, 11 Sep 2006 07:31:50 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (p549D2012.dip0.t-ipconnect.de [84.157.32.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 29EAE65967 for ; Mon, 11 Sep 2006 12:33:59 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 5BF5C1819E80B for ; Mon, 11 Sep 2006 12:31:43 +0200 (CEST) Message-ID: <45053B0F.5020109@logix-tt.com> Date: Mon, 11 Sep 2006 12:31:43 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: on connect/on disconnect References: <4504B474.9010801@cs.anu.edu.au> In-Reply-To: <4504B474.9010801@cs.anu.edu.au> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/65 X-Sequence-Number: 26276 Hi, Robert, Robert Edwards wrote: > (this is my first post to this list...) Welcome here. :-) > I am wondering if Postgres, and/or SQL in general, has a facility to > run a function at connection set-up time (after a successful connection > attempt) and/or at session completion (or disconnect)? Most JDBC connection pooling implementations will do that, at least for connection and session setup. (JBoss is one of them.) > I want to pre-populate a table (actually an INSERT rule on a view) > with some user-specific data that is unlikely to change during the > session and which is "difficult" to process (ie. affects performance > to do it too often). The problem here is that the INSERT rule might be globally visible to other, concurrent users on the database. Could you explain what exactly you want to achieve, may be we find a better way to do the whole thing. > Purely session/connection-based temporary tables would also do what > I need, but temporary tables don't seem to be able to work that way. What's the exact problem with them? Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org