Thread: Global constants

Global constants

From
"Mihai Gheorghiu"
Date:
Can there be anything like global constants in PG? They should be seen by
any session.
E.g.:
User rights are defined as int4's, with each bit representing an area where
they have access. Testing this would be easier if I had constants like
ISACCOUNTING, which I AND with the data in the rights field. I'd like to
define ISACCOUNTING=1024 sometime in the beginning (at server startup?).
Thank you.



Re: Global constants

From
Peter Eisentraut
Date:
Mihai Gheorghiu writes:

> Can there be anything like global constants in PG?

CREATE TABLE my_constant ( val integer );
INSERT INTO my_constant VALUES ( 1024 );

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: Global constants

From
Keary Suska
Date:
Setting up a table would be the most manageable, but if you don't want to do
that you could create one or more functions to accomplish this.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: "Mihai Gheorghiu" <tanethq@earthlink.net>
> Date: Thu, 20 Sep 2001 16:58:04 -0400
> To: <pgsql-general@postgresql.org>
> Subject: [GENERAL] Global constants
>
> Can there be anything like global constants in PG? They should be seen by
> any session.
> E.g.:
> User rights are defined as int4's, with each bit representing an area where
> they have access. Testing this would be easier if I had constants like
> ISACCOUNTING, which I AND with the data in the rights field. I'd like to
> define ISACCOUNTING=1024 sometime in the beginning (at server startup?).
> Thank you.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>