PG_VERSION_NUM formatted incorrectly

Started by Kieran McCuskerabout 8 years ago4 messagesbugs
Jump to latest
#1Kieran McCusker
kieran.mccusker@gmail.com

Hi

I was looking at an issue with ogr_fdw where it is trying to get
the PG_VERSION_NUM when I noticed that in Postgresql 10.1 this is declared
as:

#define PG_VERSION_NUM 100001

But shouldn't it be

#define PG_VERSION_NUM 100100

or am I being dense, in which case sorry to have bothered you.

Many Thanks

Kieran McCusker

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Kieran McCusker (#1)
Re: PG_VERSION_NUM formatted incorrectly

On Mon, Jan 22, 2018 at 11:39 AM, Kieran McCusker <kieran.mccusker@gmail.com

wrote:

Hi

I was looking at an issue with ogr_fdw where it is trying to get
the PG_VERSION_NUM when I noticed that in Postgresql 10.1 this is declared
as:

#define PG_VERSION_NUM 100001

But shouldn't it be

#define PG_VERSION_NUM 100100

or am I being dense, in which case sorry to have bothered you.

​Beginning with v10 the middle two digits with ALWAYS be zero - only the
first two (major release) and last two (patch version) are changed. 10.1
means v10 with the first patch release, unless 9.6 which is a major version
​in its own right and, with patch version, reads 9.6.3

David J.

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Kieran McCusker (#1)
Re: PG_VERSION_NUM formatted incorrectly

Kieran McCusker wrote:

Hi

I was looking at an issue with ogr_fdw where it is trying to get
the PG_VERSION_NUM when I noticed that in Postgresql 10.1 this is declared
as:

#define PG_VERSION_NUM 100001

But shouldn't it be

#define PG_VERSION_NUM 100100

or am I being dense, in which case sorry to have bothered you.

You're not being dense -- the way we're using it is indeed a bit odd.
But it was a concious decision to leave it like this: the reason is that
we've been using these two digits to indicate patch level rather than
major for so long, that is seems less likely to break version parsing
tools if we continue to do that. So the patch level for release 10 is
going to use the last two digits only, with the two middle digits
remaining constant 00 forever.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: PG_VERSION_NUM formatted incorrectly

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Kieran McCusker wrote:

But shouldn't it be
#define PG_VERSION_NUM 100100

You're not being dense -- the way we're using it is indeed a bit odd.
But it was a concious decision to leave it like this: the reason is that
we've been using these two digits to indicate patch level rather than
major for so long, that is seems less likely to break version parsing
tools if we continue to do that. So the patch level for release 10 is
going to use the last two digits only, with the two middle digits
remaining constant 00 forever.

Right. If we did it the other way, much code would think that 10.1
is a new major version, not a new minor version.

regards, tom lane