Hello all

The postgreSQL version is needed internally in order to make the code work 
because for example the type of funcctx->max_calls  changed on 9.6



uint64_t result_count = 0;


...


#if PGSQL_VERSION > 95
        funcctx->max_calls = result_count;
#else
        funcctx->max_calls = (uint32_t)result_count;
#endif


PGSQL_VERSION is a result of a manipulation of the version found using 
FindPostgres.cmake (which uses pg_config --version)

>From this message: 
>https://www.postgresql.org/message-id/1585.1472410329%40sss.pgh.pa.us


<https://www.postgresql.org/message-id/1585.1472410329%40sss.pgh.pa.us>

I deduced that in the code I can use

PG_CATALOG_VERSION


I made the following experiment:


#define STRINGIFY(s) XSTRINGIFY(s)
#define XSTRINGIFY(s) #s

#pragma message ("The value PGSQL_VERSION: " STRINGIFY(PGSQL_VERSION))
#ifdef PG_CATALOG_VERSION
#pragma message ("The value PG_CATALOG_VERSION: " STRINGIFY(PG_CATALOG_VERSION))
#endif



I have this result:

note: #pragma message: The value PGSQL_VERSION: 93

So PG_CATALOG_VERSION is not defined, then I went to see the doxygen page to 
find out which file I have to include to get the definition.
But PG_CATALOG_VERSION its not there.

So, what am I missing?

I have no problem on doing more manipulations to get a value that I can use in 
the #if PGSQL_VERSION > 95 comparison (like 100 for postgreSQL 10betaX) but if 
PG_CATALOG_VERSION is considered the best thing to look at, where can I find it?

Vicky








Reply via email to