Skip to content

Commit 29ff43a

Browse files
committed
Make numeric form of PG version number readily available in Makefiles.
Expose PG_VERSION_NUM (e.g., "90600") as a Make variable; but for consistency with the other Make variables holding similar info, call the variable just VERSION_NUM not PG_VERSION_NUM. There was some discussion of making this value available as a pg_config value as well. However, that would entail substantially more work than this two-line patch. Given that there was not exactly universal consensus that we need this at all, let's just do a minimal amount of work for now. Back-patch of commit a5d489c, so that this variable is actually useful for its intended purpose sometime before 2020. Michael Paquier, reviewed by Pavel Stehule
1 parent fdfe0b1 commit 29ff43a

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

configure

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ ac_includes_default="\
642642

643643
ac_subst_vars='LTLIBOBJS
644644
vpath_build
645+
PG_VERSION_NUM
645646
OSX
646647
XSLTPROC
647648
COLLATEINDEX
@@ -29407,6 +29408,7 @@ _ACEOF
2940729408

2940829409

2940929410

29411+
2941029412
# prepare build tree if outside source tree
2941129413
# Note 1: test -ef might not exist, but it's more reliable than `pwd`.
2941229414
# Note 2: /bin/pwd might be better than shell's built-in at getting

configure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,7 @@ AC_DEFINE_UNQUOTED(PG_VERSION_STR,
18691869
tr '.' ' ' |
18701870
$AWK '{printf "%d%02d%02d", $1, $2, (NF >= 3) ? $3 : 0}'`"]
18711871
AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
1872+
AC_SUBST(PG_VERSION_NUM)
18721873

18731874

18741875
# prepare build tree if outside source tree

src/Makefile.global.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ all:
3030
# PostgreSQL version number
3131
VERSION = @PACKAGE_VERSION@
3232
MAJORVERSION = @PG_MAJORVERSION@
33+
VERSION_NUM = @PG_VERSION_NUM@
3334

3435
# Support for VPATH builds
3536
vpath_build = @vpath_build@

0 commit comments

Comments
 (0)