X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0546311F7123 for ; Mon, 10 Apr 2006 23:17:08 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.55 X-Spam-Level: X-Spam-Status: No, score=0.55 required=5 tests=[NO_REAL_NAME=0.55] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id u2HghlSZjDOA for ; Mon, 10 Apr 2006 23:16:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailrouter.internal.box (unknown [203.48.241.83]) by postgresql.org (Postfix) with ESMTP id 23BDD11F8D16 for ; Mon, 10 Apr 2006 22:11:15 -0300 (ADT) Received: from localhost (localhost [IPv6:::1]) by mailrouter.internal.box (Postfix) with ESMTP id 0BBD8220739 for ; Tue, 11 Apr 2006 11:17:05 +1000 (EST) From: dave.bath@unix.net Reply-To: dave.bath@unix.net To: pgsql-sql@postgresql.org Subject: global variables in plpgsql? Date: Tue, 11 Apr 2006 11:17:03 +1000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604111117.04425.dave.bath@unix.net> X-Archive-Number: 200604/71 X-Sequence-Number: 24880 Folks, In v8.0.3 documentation, plperl, plpython and pltcl allow declaration of variables that are global and persistent within a session. begin_quote 37.4. Global Values in PL/Perl You can use the global hash %_SHARED to store data, including code references, between function calls for the lifetime of the current session. end_quote So, a couple of questions.... 1) Can you declare global values from plpgsql? 2) If so, is there a way of avoiding namespace pollution? (perhaps the equivalent to Oracle's use of plsql package variables) tia -- David T. Bath dave.bath@unix.net