Are globally defined constants possible at all ?

From: "Bertin, Philippe" <philippe(dot)bertin(at)barco(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Are globally defined constants possible at all ?
Date: 2002-06-07 09:34:10
Message-ID: B9E404D03707D511BD4D00105A40C10466BBEA@wevmex01.barco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello, all,

In a database we are developing, we use keys in several places. For several
reasons (a.o. speed), these have a type of integer. Select- statements
selecting on such a key (e.g. KindID) have a clause like "... where KindID =
3". In this case, the integer value 3 stands for "software". This is not so
very well readable, to my feeling.

Now my question : is there a decent way (e.g. *globally* defined constants,
or defines, or something else) by which we could make the above mentioned
clause sound something like "... where KindID = SOFTWARE". I've read a fair
part of the PostgreSQL documentation now, but haven't seen anything like
this exists (I'm not a 15- year experienced DBA, you see).

My intention is not to change the type of the keys (in this case e.g.
KindID), nor to redefine a constant in every *separate* function or
procedure. Any ideas on how to tackle this problem elegantly ?

TIA,

Philippe Bertin
Software Development Engineer Avionics

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexey Borzov 2002-06-07 09:52:59 sorting/grouping/(non-)unique indexes bug
Previous Message Ken Williams 2002-06-07 08:32:09 Problem with indexes, LIMIT, ORDER BY ... DESC