Re: [GENERAL] Backward compatibility - Mailing list pgsql-general

From Igor Korot
Subject Re: [GENERAL] Backward compatibility
Date
Msg-id CA+FnnTyc=kfO5bzkHUv3WfD=JoPsGTzUuLMH4EF6QUYO4DC1tQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Backward compatibility  (John McKown <john.archie.mckown@gmail.com>)
Responses Re: [GENERAL] Backward compatibility
List pgsql-general
Hi, John,

On Sat, Jul 22, 2017 at 8:44 AM, John McKown
<john.archie.mckown@gmail.com> wrote:
> On Fri, Jul 21, 2017 at 10:21 PM, Igor Korot <ikorot01@gmail.com> wrote:
>>
>> Hi, guys,
>> Below query does not even run:
>>
>> SELECT version(), substring( version() from position( '\s' in version() )
>> );
>>
>> Could you spot the error?
>>
>
> works for me.
>
> psql
> psql (9.5.7)
> Type "help" for help.
>
> joarmc=# SELECT version(), substring( version() from position( '\s' in
> version() ) );
>                                                   version
> |
>  substring
>
-------------------------------------------------------------------------------------------------------------+------------------------------------------------
> -------------------------------------------------------------
> PostgreSQL 9.5.7 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 6.3.1
> 20161221 (Red Hat 6.3.1-1), 64-bit | PostgreSQL 9.5.7 on
> x86_64-redhat-linux-gnu, co
> mpiled by gcc (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1), 64-bit
> (1 row)

Weird.
I started a new session of psql and it now works.

But it works incorrectly - it should return:

9.5.7 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 6.3.1 20161221
(Red Hat 6.3.1-1), 64-bit

i.e. without the word "PosgreSQL", since '\s' should match the (first)
space in the version().

Thank you.

>
>
>
> --
> Veni, Vidi, VISA: I came, I saw, I did a little shopping.
>
> Maranatha! <><
> John McKown


pgsql-general by date:

Previous
From: John McKown
Date:
Subject: Re: [GENERAL] Backward compatibility
Next
From: Tom Lane
Date:
Subject: Re: [GENERAL] Backward compatibility