Re: 10.0

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 10.0
Date: 2016-06-13 19:12:40
Message-ID: CAHyXU0z2SmDWbp7mcjOs+rsctW5WpDhax-2h6fsSg_Ra_Dm3zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 17, 2016 at 12:45 AM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> On 14 May 2016 at 02:49, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>
>> * This year's major release will be 9.6.0, with minor updates 9.6.1,
>> 9.6.2, etc. It's too late to do otherwise for this release cycle.
>>
>> * Next year's major release will be 10.0, with minor updates 10.1,
>> 10.2, etc.
>>
>> * The year after, 11.0. Etc cetera.
>>
>
> Yes. Please!
>
> I get tired of explaining to people that PostgreSQL "9.x" isn't a thing,
> that yes, 9.3 and 9.4 really _do_ have incompatible data directories and
> replication protocols, and that when the docs say "major version" they don't
> mean "major version as you might actually expect" but "first two version
> number parts".
>
> Lets get rid of this user-baffling wart.

Agreed. What's been nagging me is what the impacts to users could be.
I just stumbled across some code that *could* have been broken, but by
sheer luck it's safe:

/* only postgres 9.3+ supports row count from 'COPY' */
IF substring(version() FROM $q$([0-9]+\.[0-9]+)$q$)::NUMERIC >= 9.3
THEN
GET DIAGNOSTICS _RowCount = ROW_COUNT;
ELSE
_RowCount := (LineCount(_ScratchFileName,
(SELECT WorkFolder FROM CDSControl)))::BIGINT - 1;
END IF;

LineCount() is a pl/sh wrapper to 'wc -l' that supports this wrapper
to COPY so that it always gives a count of rows loaded. I guess this
is a pretty hacky way of doing version checks inside of SQL but I
suppose changing the structure of the version number might break
similar approaches to parsing the string. This regex would in fact
continue to work properly, but it did raise some alarm bells.

Looking ahad, IMO we could:

A) make a variant of version() that returns major/minor/bugfix as
separate fields with minor being set to 0 for all released versions
10.0 and beyond. We could then add a NOTE to the version function and
other places suggesting to use that instead for 9.6.

B) Preserve x.y.z as returned by version() and show server_version for
those usages only, with 'y' being always 0 for 10.0 and beyond. For
all other purposes (marketing/documentation/etc) that structure would
*not* be preserved, and we would put notes in the documentation
describing why the extra digit is there.

C) Do neither A or B, and let our users discover such issues on their own.

merlin

In response to

  • Re: 10.0 at 2016-05-17 05:45:09 from Craig Ringer

Responses

  • Re: 10.0 at 2016-06-14 19:46:19 from Jim Nasby

Browse pgsql-hackers by date

  From Date Subject
Next Message 'bruce@momjian.us' 2016-06-13 19:40:08 Re: Prepared statements and generic plans
Previous Message Vladimir Borodin 2016-06-13 18:58:30 Re: [PERFORM] 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6