X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C1BC1D1B548 for ; Sun, 26 Oct 2003 03:45:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42162-06 for ; Sun, 26 Oct 2003 00:44:46 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 27BC1D1B51A for ; Sun, 26 Oct 2003 00:44:46 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id h9Q3ijNu018582 for ; Sun, 26 Oct 2003 03:44:45 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h9Q3UQGm017161 for pgsql-sql@postgresql.org; Sun, 26 Oct 2003 03:30:26 GMT From: nzanella@cs.mun.ca (Neil Zanella) X-Newsgroups: comp.databases.postgresql.sql Subject: defining and using constants in postgreSQL Date: 25 Oct 2003 20:30:25 -0700 Organization: http://groups.google.com Lines: 20 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/334 X-Sequence-Number: 15734 Hello, I am looking for a way that I can define a constant in PostgreSQL (so that I end up with a constant similar to one that I could have in Oracle). I have searched the archives and it seems that the solutions that were suggested in include creating a table of constants or alternatively creating a function that returns a constant. However, I would like to have a predefined constant in the global scope which I can access without the round brackets used to call a function. That is, I would like to be able to define a constant named foo that I can then access with the name foo, not foo(). Is this possible at all with PostgreSQL? I know PostgreSQL has some predefined constants that don't take the round brackets so in principle it should be possible to define more. Is there a way to do such thing in PostgreSQL? Thanks, Neil