X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id DE00ED1B547; Sat, 20 Sep 2003 14:50:34 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 61390-07; Sat, 20 Sep 2003 11:50:07 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id C18E9D1B576; Sat, 20 Sep 2003 11:50:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id h8KEo1iP023475; Sat, 20 Sep 2003 10:50:01 -0400 (EDT) To: Richard Huxton Cc: newsy@lewczuk.com, "Lista dyskusyjna pgsql-php" , "Lista dyskusyjna pgsql-general" Subject: Re: PG + PHP, was Re: Zend survey result about dbms... In-reply-to: <200309201248.54484.dev@archonet.com> References: <000501c37e9e$0ecffc70$4701a8c0@marek> <20022.1063984707@sss.pgh.pa.us> <200309201248.54484.dev@archonet.com> Comments: In-reply-to Richard Huxton message dated "Sat, 20 Sep 2003 12:48:54 +0100" Date: Sat, 20 Sep 2003 10:50:00 -0400 Message-ID: <23474.1064069400@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/1346 X-Sequence-Number: 49565 Richard Huxton writes: > One thing I think would be useful is another pseudo-var in PG, > something like APP_SESSION_VAR which can be set and then used in PG > queries. > Tom - if I offered to produce a patch for something like this - either a var > or a function pair (get_app_session_var(), set_app_session_var(varchar)) > would it be likely to be accepted? It'd depend a lot on the details of what you propose, I think. True variables seem like they'd be rather invasive, not to mention possibly error-prone (is "foo" a variable or a column reference?). However you could do something pretty self-contained in the form of a couple of functions. I'd suggest they support more than just one variable, btw. How about "set_session_variable(varname, varvalue)" and "get_session_variable(varname)"? I should think we'd at least accept that as a contrib module; whether it would become mainstream would probably depend on the level of interest. regards, tom lane