Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jE6ep-0002NB-I3 for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 07:28:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jE6eo-0007TI-8E for pgsql-general@arkaria.postgresql.org; Tue, 17 Mar 2020 07:28:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jE6en-0007TA-S1 for pgsql-general@lists.postgresql.org; Tue, 17 Mar 2020 07:28:57 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jE6el-0003pg-GR for pgsql-general@postgresql.org; Tue, 17 Mar 2020 07:28:57 +0000 Received: by mail-lj1-x244.google.com with SMTP id f10so21586722ljn.6 for ; Tue, 17 Mar 2020 00:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=mvdblkvnvc0DHfdkSQfDnaZuHJD3YC3XbVJEi0znqfg=; b=AceioNb3Sg1ZR5LBHbOaUv5TS/DDxoVF+CWQGgxtsBhW6vM6mNe/wkeuNMg5pAyjcD wjeSsuRMKcwjUpUlwQCBcnksiXooz1inqeGBj7x9saT/hQ3+btTbMMIkbefRmhO/4uxT pL/uswn7eSsqyfyKGFPIPFQHst+3NGbb+kaaTVc10MKwhjQrIOaJizTl5dVd65oPi96X YcIAk2TSZn4l4Kl+w+O0t9nfF8MfVQl5tfDyTywedql2ts3Sr+FlLcXMt7A2TnT54O4Q rOdar7oyVRspsdDJsv+kRqBU56wVGt0GO+IgPr9WCQMki6uT4yfxz50NcmsXfxqgrpXH YyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=mvdblkvnvc0DHfdkSQfDnaZuHJD3YC3XbVJEi0znqfg=; b=sq6wbAjQezpevwebI+wDZbwMIlyg8nYwiXWtODvLBeS/v89SqM/j8Z/oJ8z8RZ+C13 W1ZOfHwAkYMUEbnbuzi+VmDzPwAoD3z3stpmvw1xu/Rcqyshbx5nY/kQD00EsAwr4T92 7YfZ4MvhRJDMnajI5CBNkINHezE+vBLgXZCqRG27oNrtHbZbcyfIngoU71lWTkVp57SP wzxWycdiDXF1BHuKMslwQijqIAhAJWGEMDXcktWl8GqpyHblGtCsE9anpjzJbH6rrrTj /1nJ+pGNsnakr91u3AawBKgyLlQHPdnwF+03SH0/uA46oU8lueceylZE+NfOJrI+o8eC w45Q== X-Gm-Message-State: ANhLgQ1D5/rtiJAFL/GLCTbySvp73g6PyEvq7PI8jKczIZ2DkiCaT9j4 7d0t8hbHzR89Sffz/TC5wtbgWA0Zw7rgWw== X-Google-Smtp-Source: ADFU+vugHzlky/4lbA8mKwuQzGqUnMwXBSqcYsS7tV8oaeQkPRYD4qye48WdUOPTTvvEgZsKj4COfg== X-Received: by 2002:a2e:9cc1:: with SMTP id g1mr1947782ljj.152.1584430134533; Tue, 17 Mar 2020 00:28:54 -0700 (PDT) Received: from [192.168.1.183] (81-235-44-100-no276.tbcn.telia.com. [81.235.44.100]) by smtp.gmail.com with ESMTPSA id j7sm1734257lfm.65.2020.03.17.00.28.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2020 00:28:53 -0700 (PDT) From: =?utf-8?Q?Bj=C3=B6rn_Lundin?= Message-Id: <5E2FF59B-3E85-42C8-9C83-FED22A337695@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_01DA1E24-65E3-48B1-BA03-8E659E3F356D" Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Order by and timestamp SOLVED Date: Tue, 17 Mar 2020 08:28:52 +0100 In-Reply-To: <1776fcbe-d55a-2059-7abf-0a615896a871@aklaver.com> Cc: Tom Lane , pgsql-general@postgresql.org To: Adrian Klaver References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <24142.1584319263@sss.pgh.pa.us> <7D74B8B5-DFBD-4B5B-85C6-A516343E49C1@gmail.com> <346C3B58-D29E-4CC2-8200-691ECA91F494@gmail.com> <10f84f23-6011-28ab-79a1-a1c259424d2e@aklaver.com> <72890A04-294E-4753-8839-69F0BAD9AA17@gmail.com> <9004c731-b2eb-faaa-6dc9-6ebd231c5879@aklaver.com> <5e1a2f75-2d9c-889b-7504-63edb615caf6@aklaver.com> <33EA1F8F-5B37-41DD-B045-88FC8D207AC6@gmail.com> <1776fcbe-d55a-2059-7abf-0a615896a871@aklaver.com> X-Mailer: Apple Mail (2.3445.9.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_01DA1E24-65E3-48B1-BA03-8E659E3F356D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 >> So insert is >> bnl@ibm2:~/db$ psql >> Tidtagning =C3=A4r p=C3=A5. >> AUTOCOMMIT off >> psql (9.6.15, server 9.4.15) >> Skriv "help" f=C3=B6r hj=C3=A4lp. >=20 > Except you are using psql 9.6.15 against a 9.4.15 server. >=20 > What happens if you use psql(9.4.15) to do sort query against 9.4.15 = server? So this is more than strange bnl@ibm2:~$ /usr/lib/postgresql/9.4/bin/psql Timing is on. AUTOCOMMIT off psql (9.4.15) Type "help" for help. This. works. I did not realize I ran different client/server versions. 9.6 must have come with a Debian upgrade where I did not migrate the = database to 9.6,=20 but got the psql 9.6 as default (/sr/bin/psql) However AFTER I checked the bad sorting - sep/oct 2016 and early apr = 2017=20 With psql 9.4 I connected with psql 9.6 again. And now the sorting error is gone her too! I cannot reproduce it anymore So I learned this - always use same version of client and server Many thanks to Adrian and Tom -- Bj=C3=B6rn Lundin b.f.lundin@gmail.com --Apple-Mail=_01DA1E24-65E3-48B1-BA03-8E659E3F356D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8


So insert is
bnl@ibm2:~/db$ = psql
Tidtagning =C3=A4r p=C3=A5.
AUTOCOMMIT = off
psql (9.6.15, server 9.4.15)
Skriv = "help" f=C3=B6r hj=C3=A4lp.

Except you are using psql 9.6.15 against a 9.4.15 server.

What happens if you use psql(9.4.15) to do = sort query against 9.4.15 server?

So this is = more than strange

bnl@ibm2:~$ = /usr/lib/postgresql/9.4/bin/psql
Timing = is on.
AUTOCOMMIT off
psql = (9.4.15)
Type = "help" for help.


This. works. I did not realize I ran = different client/server versions.
9.6 must have come with a Debian upgrade where I = did not migrate the database to 9.6, 
but got the psql 9.6 as default = (/sr/bin/psql)


However AFTER I checked the bad sorting - sep/oct = 2016 and early apr 2017 
With psql 9.4 I connected with = psql 9.6 again.
And now the sorting error is  gone her = too!

I cannot reproduce it = anymore

So I learned this - always = use same version of client and server

Many thanks to Adrian and Tom


--
Bj=C3=B6rn Lundin




= --Apple-Mail=_01DA1E24-65E3-48B1-BA03-8E659E3F356D--