Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-07-05 Thread Pavel Stehule
2015-07-05 16:51 GMT+02:00 Tom Lane : > Michael Paquier writes: > > On Fri, Jul 3, 2015 at 6:27 AM, Tom Lane wrote: > >> Michael Paquier writes: > >>> ... So attached is a patch that adds VERSION_NUM in > >>> Makefile.global. > > >> While there was not exactly universal consensus that we need t

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-07-05 Thread Andres Freund
On 2015-07-05 10:51:48 -0400, Tom Lane wrote: > Any objections to doing that? Nope. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-07-05 Thread Tom Lane
Michael Paquier writes: > On Fri, Jul 3, 2015 at 6:27 AM, Tom Lane wrote: >> Michael Paquier writes: >>> ... So attached is a patch that adds VERSION_NUM in >>> Makefile.global. >> While there was not exactly universal consensus that we need this, the >> patch as given is merely two lines, so i

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-07-02 Thread Michael Paquier
On Fri, Jul 3, 2015 at 6:27 AM, Tom Lane wrote: > Michael Paquier writes: >> On Wed, Mar 25, 2015 at 8:26 AM, Tom Lane wrote: >> ... So attached is a patch that adds VERSION_NUM in >> Makefile.global. > > While there was not exactly universal consensus that we need this, the > patch as given is

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-07-02 Thread Tom Lane
Michael Paquier writes: > On Wed, Mar 25, 2015 at 8:26 AM, Tom Lane wrote: > ... So attached is a patch that adds VERSION_NUM in > Makefile.global. While there was not exactly universal consensus that we need this, the patch as given is merely two lines, so it seems awfully cheap to Just Do It.

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-06-30 Thread Pavel Stehule
Review: 1. Discussion - I read all discussion and majority opinion is positive to this patch. I am for this patch too. I had to solve same issues with Orafce project. More - this patch is terrible simple - it is just the publishing already prepared value. 2. There was not any problem with patchi

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-04-06 Thread Jim Nasby
On 4/1/15 1:25 AM, Andrew Gierth wrote: "Michael" == Michael Paquier writes: Michael> For an extension that has a single branch compatible with a Michael> set of multiple major versions of Postgres, the cases are Michael> custom values for REGRESS_OPTS and REGRESS depending on the Mich

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-31 Thread Andrew Gierth
> "Michael" == Michael Paquier writes: Michael> For an extension that has a single branch compatible with a Michael> set of multiple major versions of Postgres, the cases are Michael> custom values for REGRESS_OPTS and REGRESS depending on the Michael> backend version. I also manipulate o

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-31 Thread Michael Paquier
On Wed, Apr 1, 2015 at 8:50 AM, Peter Eisentraut wrote: > On 3/31/15 1:05 AM, Michael Paquier wrote: > > > > > > On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut > > wrote: > > > > On 3/30/15 6:29 PM, Michael Paquier wrote: > > > > > > > > > On Tue, Mar 3

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-31 Thread Peter Eisentraut
On 3/31/15 1:05 AM, Michael Paquier wrote: > > > On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut > wrote: > > On 3/30/15 6:29 PM, Michael Paquier wrote: > > > > > > On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut > >

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-31 Thread Michael Paquier
On Wed, Apr 1, 2015 at 4:09 AM, Tom Lane wrote: > Michael Paquier writes: > > On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut > wrote: > >> I'm interested in the exact syntax you'd use, to compare it to the > >> currently used techniques. > > > With the presence of VERSION_NUM directly in pg_

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-31 Thread Tom Lane
Michael Paquier writes: > On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut wrote: >> I'm interested in the exact syntax you'd use, to compare it to the >> currently used techniques. > With the presence of VERSION_NUM directly in pg_config, the following > expression: > VERSION_NUM=$(shell $(PG_

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-30 Thread Michael Paquier
On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut wrote: > On 3/30/15 6:29 PM, Michael Paquier wrote: > > > > > > On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut > > wrote: > > > > On 3/25/15 1:32 AM, Michael Paquier wrote: > > > Well, I have no other cases than

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-30 Thread Peter Eisentraut
On 3/30/15 6:29 PM, Michael Paquier wrote: > > > On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut > wrote: > > On 3/25/15 1:32 AM, Michael Paquier wrote: > > Well, I have no other cases than ones of the type mentioned upthread, > > and honestly I am fine as

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-30 Thread David Fetter
On Tue, Mar 31, 2015 at 07:29:07AM +0900, Michael Paquier wrote: > On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut wrote: > > > On 3/25/15 1:32 AM, Michael Paquier wrote: > > > Well, I have no other cases than ones of the type mentioned upthread, > > > and honestly I am fine as long as we do no

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-30 Thread Michael Paquier
On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut wrote: > On 3/25/15 1:32 AM, Michael Paquier wrote: > > Well, I have no other cases than ones of the type mentioned upthread, > > and honestly I am fine as long as we do not apply maths to a version > > string. So attached is a patch that adds VER

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-30 Thread Peter Eisentraut
On 3/25/15 1:32 AM, Michael Paquier wrote: > Well, I have no other cases than ones of the type mentioned upthread, > and honestly I am fine as long as we do not apply maths to a version > string. So attached is a patch that adds VERSION_NUM in > Makefile.global. How would you make use of this in a

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-29 Thread Michael Paquier
On Wed, Mar 25, 2015 at 2:32 PM, Michael Paquier wrote: > On Wed, Mar 25, 2015 at 8:26 AM, Tom Lane wrote: >> Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM >> to the makefiles, but I did not hear one for adding it to pg_config; and >> doing the former takes about two l

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-26 Thread Jim Nasby
On 3/25/15 2:00 PM, Andres Freund wrote: On 2015-03-25 14:50:44 -0400, Tom Lane wrote: >Jim Nasby writes: > >On 3/24/15 6:26 PM, Tom Lane wrote: > >>Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM > >>to the makefiles, but I did not hear one for adding it to pg_confi

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-25 Thread Andres Freund
On 2015-03-25 14:50:44 -0400, Tom Lane wrote: > Jim Nasby writes: > > On 3/24/15 6:26 PM, Tom Lane wrote: > >> Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM > >> to the makefiles, but I did not hear one for adding it to pg_config; and > >> doing the former takes about t

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-25 Thread Tom Lane
Jim Nasby writes: > On 3/24/15 6:26 PM, Tom Lane wrote: >> Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM >> to the makefiles, but I did not hear one for adding it to pg_config; and >> doing the former takes about two lines whereas adding a pg_config option >> entails qu

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-25 Thread Jim Nasby
On 3/24/15 6:26 PM, Tom Lane wrote: Andrew Gierth writes: "Tom" == Tom Lane writes: Tom> I concur with Michael that there's value in exposing the version Tom> number in the numeric form used by PG_VERSION_NUM. However, I Tom> also concur with Andrew that if the use-case for this is To

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-24 Thread Michael Paquier
On Wed, Mar 25, 2015 at 8:26 AM, Tom Lane wrote: > Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM > to the makefiles, but I did not hear one for adding it to pg_config; and > doing the former takes about two lines whereas adding a pg_config option > entails quite a lot o

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-24 Thread David Fetter
On Tue, Mar 24, 2015 at 07:26:18PM -0400, Tom Lane wrote: > Andrew Gierth writes: > > "Tom" == Tom Lane writes: > > Tom> I concur with Michael that there's value in exposing the version > > Tom> number in the numeric form used by PG_VERSION_NUM. However, I > > Tom> also concur with Andrew tha

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-24 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> I concur with Michael that there's value in exposing the version > Tom> number in the numeric form used by PG_VERSION_NUM. However, I > Tom> also concur with Andrew that if the use-case for this is > Tom> Makefiles, pg_config is a pret

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-24 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Michael> Well, my point is to have something on which you can directly Michael> apply maths on without changing its shape ;) >> There's this trick: >> # if version < 9.1 ... >> ifeq ($(filter-out 7.% 8.% 9.0, $(MAJORVERSION)),) >> # stuff >> endif >> # i

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-24 Thread Tom Lane
Andrew Gierth writes: > "Michael" == Michael Paquier writes: > Michael> Well, my point is to have something on which you can directly > Michael> apply maths on without changing its shape ;) > There's this trick: > # if version < 9.1 ... > ifeq ($(filter-out 7.% 8.% 9.0, $(MAJORVERSION)),) > #

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-23 Thread Andrew Gierth
> "Michael" == Michael Paquier writes: >> MAJORVERSION is defined in Makefile.global as included by PGXS, fwiw. Michael> Well, my point is to have something on which you can directly Michael> apply maths on without changing its shape ;) There's this trick: # if version < 9.1 ... ifeq ($

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-23 Thread Michael Paquier
On Tue, Mar 24, 2015 at 4:06 AM, Andrew Gierth wrote: >> "Michael" == Michael Paquier writes: > > Michael> Hi all, > Michael> When working on extensions or packaging, one can do some > Michael> grep-ing on pg_config.h to get PG_VERSION_NUM to do > Michael> version-related operations. An e

Re: [HACKERS] Exposing PG_VERSION_NUM in pg_config

2015-03-23 Thread Andrew Gierth
> "Michael" == Michael Paquier writes: Michael> Hi all, Michael> When working on extensions or packaging, one can do some Michael> grep-ing on pg_config.h to get PG_VERSION_NUM to do Michael> version-related operations. An example of that is the Makefile Michael> of plv8 using --include-