Commit 03024ca5 authored by Bruce Momjian's avatar Bruce Momjian

Add PG_VERSION_NUM for use by 3rd party applications wanting to test the

backend version in C using > and < comparisons.
parent d2c555ee
...@@ -4742,6 +4742,14 @@ fi ...@@ -4742,6 +4742,14 @@ fi
fi fi
# Supply a numeric version string for use by 3rd party add-ons
PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/A-Za-z.*$//' |
$AWK -F'\.' '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
cat >>confdefs.h <<_ACEOF
#define PG_VERSION_NUM $PG_VERSION_NUM
_ACEOF
## ##
## Libraries ## Libraries
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.450 2006/02/21 06:06:50 tgl Exp $ dnl $PostgreSQL: pgsql/configure.in,v 1.451 2006/02/28 16:41:21 momjian Exp $
dnl dnl
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -26,7 +26,7 @@ AC_CONFIG_AUX_DIR(config) ...@@ -26,7 +26,7 @@ AC_CONFIG_AUX_DIR(config)
AC_PREFIX_DEFAULT(/usr/local/pgsql) AC_PREFIX_DEFAULT(/usr/local/pgsql)
AC_SUBST(configure_args, [$ac_configure_args]) AC_SUBST(configure_args, [$ac_configure_args])
AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version]) AC_DEFINE_UNQUOTED(PG_VERSION, "$PACKAGE_VERSION", [PostgreSQL version as a string])
AC_CANONICAL_HOST AC_CANONICAL_HOST
...@@ -585,6 +585,10 @@ if test "$with_python" = yes; then ...@@ -585,6 +585,10 @@ if test "$with_python" = yes; then
PGAC_CHECK_PYTHON_EMBED_SETUP PGAC_CHECK_PYTHON_EMBED_SETUP
fi fi
# Supply a numeric version string for use by 3rd party add-ons
PG_VERSION_NUM="`echo "$PACKAGE_VERSION" | sed 's/[A-Za-z].*$//' |
$AWK -F'\.' '{printf \"%d%02d%02d\", $1, $2, (NF >= 3) ? $3 : 0}'`"
AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
## ##
## Libraries ## Libraries
......
...@@ -547,9 +547,12 @@ ...@@ -547,9 +547,12 @@
(--with-krb-srvnam=NAME) */ (--with-krb-srvnam=NAME) */
#undef PG_KRB_SRVNAM #undef PG_KRB_SRVNAM
/* PostgreSQL version */ /* PostgreSQL version as a string */
#undef PG_VERSION #undef PG_VERSION
/* PostgreSQL version as a number */
#undef PG_VERSION_NUM
/* A string containing the version number, platform, and C compiler */ /* A string containing the version number, platform, and C compiler */
#undef PG_VERSION_STR #undef PG_VERSION_STR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment