Received: from ns.krot.org (ns.krot.org [193.212.103.165]) by postgresql.org (8.11.3/8.11.4) with SMTP id f9H12oP41850 for ; Tue, 16 Oct 2001 21:02:50 -0400 (EDT) (envelope-from postgresql@envisity.com) Received: (qmail 4771 invoked by uid 67); 17 Oct 2001 01:00:54 -0000 Message-ID: <20011017010054.28016.qmail@ns.krot.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline MIME-Version: 1.0 From: "Aasmund Midttun Godal" To: pgsql-sql@postgresql.org Subject: Variables. Date: Wed, 17 Oct 2001 01:00:54 GMT X-Mailer: Googley-Moogley Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by postgresql.org id f9H1eDM49047 X-Archive-Number: 200110/224 X-Sequence-Number: 5179 I would really like a feature :) I do not know whether it is part of the SQL standard. Variables... e.g. CREATE VARIABLE foobar INTEGER DEFAULT 1 NOT NULL; SELECT * FROM thebar WHERE id = foobar; CREATE TEMPORARY VARIABLE... CREATE CONSTANT.... Basically all the functionality from the table columns (CHECK and REFERENCES...) and it must take any type, so that you can use user-created types as well. SET foobar 3; it could adopt properties from both runtime info and sequences... My abilities in C, as in many other things is severely limited so I am asking someone else to do the dirtywork :). And I do appreciate that this may take some time. It would be nice to have some sort of GRANT revoke SCHEME on it too... I do acknowledge that this can be achieved with temporary and non temporary tables, but it can get ugly with these. While I am at it I would highly suggest that there is some sort of SESSION_ID environment variable. Some of the uses: * Store things like personal preferences * Parameters from a webserver * Client application name * etc. Aasmund Midttun Godal aasmund@godal.com - http://www.godal.com/ +47 40 45 20 46