Re: Exposing PG_VERSION_NUM in pg_config
От | Michael Paquier |
---|---|
Тема | Re: Exposing PG_VERSION_NUM in pg_config |
Дата | |
Msg-id | CAB7nPqRCA3k7X-MhHbZjE7fORC1dmzjpZSMv3Qgq0CVQM0aSLA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Exposing PG_VERSION_NUM in pg_config (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: Exposing PG_VERSION_NUM in pg_config
(Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: Exposing PG_VERSION_NUM in pg_config (Pavel Stehule <pavel.stehule@gmail.com>) |
Список | pgsql-hackers |
<div dir="ltr"><br /><div class="gmail_extra"><br /><div class="gmail_quote">On Wed, Apr 1, 2015 at 8:50 AM, Peter Eisentraut<span dir="ltr"><<a href="mailto:peter_e@gmx.net" target="_blank">peter_e@gmx.net</a>></span> wrote:<br /><blockquoteclass="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><spanclass="">On 3/31/15 1:05 AM, Michael Paquier wrote:<br /> ><br /> ><br /> >On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut <<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a><br /></span><spanclass="">> <mailto:<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>>> wrote:<br /> ><br/> > On 3/30/15 6:29 PM, Michael Paquier wrote:<br /> > ><br /> > ><br /> > >On Tue, Mar 31, 2015 at 5:39 AM, Peter Eisentraut <<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a> <mailto:<ahref="mailto:peter_e@gmx.net">peter_e@gmx.net</a>><br /></span><span class="">> > <mailto:<ahref="mailto:peter_e@gmx.net">peter_e@gmx.net</a> <mailto:<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>>>>wrote:<br /> > ><br /> > > On 3/25/151:32 AM, Michael Paquier wrote:<br /> > > > Well, I have no other cases than ones of the type mentionedupthread,<br /> > > > and honestly I am fine as long as we do not apply maths to a version<br />> > > string. So attached is a patch that adds VERSION_NUM in<br /> > > > Makefile.global.<br/> > ><br /> > > How would you make use of this in an extension makefile?<br />> ><br /> > ><br /> > > One use case is regression test list filtering depending on backendversion.<br /> ><br /> > I'm interested in the exact syntax you'd use, to compare it to the<br /> > currently used techniques.<br /> ><br /> ><br /> > With the presence of VERSION_NUM directly in pg_config,the following<br /> > expression:<br /> > VERSION_NUM=$(shell $(PG_CONFIG) --version-num)<br /><br /></span>Myquestion is, once you have this version number in a variable like<br /> VERSION_NUM, what specifically would youdo with it?<br /></blockquote></div><br /></div><div class="gmail_extra">For an extension that has a single branch compatiblewith a set of multiple major versions of Postgres, the cases are custom values for REGRESS_OPTS and REGRESS dependingon the backend version. I also manipulate on a daily basis the same set of scripts across many platforms (on Windowsas well using msysgit, and MSVC installation does not have pgxs stuff), so I would use it to simplify them. It istrue that you can already do that by parsing the output of "pg_config --version", and that I would need to maintain bothversions for some time (custom parsing of pg_config --version, and use of --version-num if this patch is accepted) butit looks IMO tempting to have directly the version number thinking long term if there is a simple integer number availableat hand to identify a given version of PG.<br /></div><div class="gmail_extra">-- <br /><div class="gmail_signature">Michael<br/></div></div></div>
В списке pgsql-hackers по дате отправления: