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
---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])