Re: 10.0

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Josh berkus <josh(at)agliodbs(dot)com>, David Fetter <david(at)fetter(dot)org>, Thom Brown <thom(at)linux(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 10.0
Date: 2016-06-14 21:58:44
Message-ID: CAHyXU0yPrEG_d8vBmZP+mFHA-ci-wt7om_SMdvyypHhDbx5+Pw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 14, 2016 at 4:13 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 6/14/16 3:56 PM, Tom Lane wrote:
>>
>> Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
>>>
>>> On 6/14/16 3:01 PM, Robert Haas wrote:
>>>>
>>>> This seems kind of silly, because anybody who is writing code that
>>>> might have to run against an existing version of the database won't be
>>>> able to use it. The one thing that absolutely has to be cross-version
>>>> is the method of determining which version you're running against.
>>
>>
>>> We're talking about a function that doesn't currently exist anyway.
>>
>>
>> Huh? We're talking about PQserverVersion(), comparisons to
>> PG_VERSION_NUM,
>> and related APIs. Those most certainly exist now, and trying to supplant
>> them seems like a giant waste of time.
>>
>> On the other hand, parsing fields out of version() mechanically has been
>> deprecated for as long as those other APIs have existed (which is since
>> 8.0 or so). version() is only meant for human consumption, so I see no
>> reason it shouldn't just start returning "10.0", "10.1", etc. If that
>> breaks anyone's code, well, they should have switched to one of the
>> easier methods years ago.
>
>
> The original post was:
>
>> IF substring(version() FROM $q$([0-9]+\.[0-9]+)$q$)::NUMERIC >= 9.3
>
> and \df *version* on my HEAD doesn't show any other options.

Right. It's the only way to handle things on the SQL level well,
that, and pg_settings approaches. In other words, there is no easier
way. I think it's pretty reasonable to assume there's a lot more code
interfacing with the database from SQL than from C.

merlin

In response to

  • Re: 10.0 at 2016-06-14 21:13:52 from Jim Nasby

Responses

  • Re: 10.0 at 2016-06-14 22:48:08 from David G. Johnston

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2016-06-14 22:48:08 Re: 10.0
Previous Message Bruce Momjian 2016-06-14 21:35:00 Re: Use of index for 50% column restriction