Are globally defined constants possible at all ?
От | Bertin, Philippe |
---|---|
Тема | Are globally defined constants possible at all ? |
Дата | |
Msg-id | B9E404D03707D511BD4D00105A40C10466BBEA@wevmex01.barco.com обсуждение исходный текст |
Ответы |
Re: Are globally defined constants possible at all ?
|
Список | 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
В списке pgsql-general по дате отправления: