How to check the postgresql version
От | Ruey-Lung Hsiao |
---|---|
Тема | How to check the postgresql version |
Дата | |
Msg-id | AlPmd.22363$6q2.1705@newssvr14.news.prodigy.com обсуждение исходный текст |
Ответы |
Re: How to check the postgresql version
Re: How to check the postgresql version |
Список | pgsql-hackers |
Hi, Sorry if this problem seems stupid but I would appreciate it if someone helps. I've been implementing several user-defined types and their corresponding GiST index in postgresql 7.4.3. They worked well. However, I have noticed there are several changes in SPI functions and their parameters in 8.0beta. I want to be able to compile my codes in Postgresql 7.4.X and 8.0.X, so the only way to do that is to use the C preprocessor directives to check PG_VERSION (defined in pg_config.h). My problem is: I can't find a way to compare strings in C preprocessor directive since PG_VERSION is defined as something like "7.4.3" or "7.4.6". I ultimately want to do the following things: #if PG_VERSION starts with "8.X" ... call 8.0 compatible functions #else ... call 7.4.x compatible functions #endif Could anyone tell me how to do this kind of version check task? Thank you very much. Ruey-Lung Hsiao
В списке pgsql-hackers по дате отправления: