pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Björn Lundin <b.f.lundin@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Order by and timestamp SOLVED
Date: Tue, 17 Mar 2020 15:39:16 +0100
Message-ID: <D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com> (raw)
In-Reply-To: <31986.1584453901@sss.pgh.pa.us>
References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com>
	<c171c26b-fd5e-b4bf-ec86-97b6f8dbcbe0@aklaver.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>
	<B8742026-DBCA-475E-9036-65C61DA2639B@gmail.com>
	<5e1a2f75-2d9c-889b-7504-63edb615caf6@aklaver.com>
	<33EA1F8F-5B37-41DD-B045-88FC8D207AC6@gmail.com>
	<1776fcbe-d55a-2059-7abf-0a615896a871@aklaver.com>
	<5E2FF59B-3E85-42C8-9C83-FED22A337695@gmail.com>
	<31986.1584453901@sss.pgh.pa.us>

17 mars 2020 kl. 15:05 skrev Tom Lane <tgl@sss.pgh.pa.us>:
> 
> =?utf-8?Q?Bj=C3=B6rn_Lundin?= <b.f.lundin@gmail.com> writes:
>>> What happens if you use psql(9.4.15) to do sort query against 9.4.15 server?
> 
>> 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!
> 
> Boy ... I don't have any confidence in that answer.

It is not an answer. It is an observation.

>  psql does not re-sort
> data, nor does it have any way to affect what the server does.

I did not say that. I do not think that.
But - still I got the above result
* bad order with psql 9.6 towards db 9.4
* good order with psql 9.4 towards db 9.4
* good order with psql 9.6 towards db 9.4

>  It seems
> to me that if this actually is a version inconsistency problem, that's
> a bug in itself.
> I am starting to wonder though if you had psql's FETCH_COUNT option
> active in one configuration and not the other, and if so whether that
> could explain anything.

FETCH_COUNT is a variable set in runtime / read by .psqlrc?
Then it is the same. 
I have 1 .psqlrc on ibm2.

bnl@ibm2:~$ locate .psqlrc
/home/bnl/.psqlrc
bnl@ibm2:~$ 

bnl@ibm2:~$ cat .psqlrc
\timing 
\set AUTOCOMMIT 'off' 
\echo 'AUTOCOMMIT' :AUTOCOMMIT



But I do notice that in .psqlrc_history I see strange ’040’ - sometimes 
bnl@ibm2:~$ cat .psql_history
_HiStOrY_V2_
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040amarkets\040order\040by\040startts;
select * from amarkets order by startts;  
select\040*\040from\040amarkets\040order\040by\040startts;



So I now did 
bnl@ibm2:~$ find / -name psql
/usr/lib/postgresql/9.4/bin/psql
/usr/lib/postgresql/9.6/bin/psql
^C
bnl@ibm2:~$ /usr/lib/postgresql/9.4/bin/psql
Timing is on.
AUTOCOMMIT off
psql (9.4.15)
Type "help" for help.

bnl=> select * from AEVENTS order by OPENTS;
<output omitted, was ok. Different statement too see if that is added to .psql_history>
Time: 278,207 ms


bnl@ibm2:~$ cat .psqlrc
\timing 
\set AUTOCOMMIT 'off' 
\echo 'AUTOCOMMIT' :AUTOCOMMIT

bnl@ibm2:~$ cat .psql_history
_HiStOrY_V2_
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040amarkets\040order\040by\040startts;\040\040
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040AEVENTS\040order\040by\040OPENTS;

And yes it is
Trying 9.6

bnl@ibm2:~$ /usr/lib/postgresql/9.6/bin/psql
Tidtagning är på.
AUTOCOMMIT off
psql (9.6.15, server 9.4.15)
Skriv "help" för hjälp.

bnl=> select * from AEVENTS order by OPENTS limit 1;
<output omitted, was ok. Different statement again too see if that is added to .psql_history>
Tid: 19,240 ms
bnl=> ^D\q



bnl@ibm2:~$ cat .psql_history
_HiStOrY_V2_
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040amarkets\040order\040by\040startts;\040\040
select\040*\040from\040amarkets\040order\040by\040startts;
select\040*\040from\040AEVENTS\040order\040by\040OPENTS;
select\040*\040from\040AEVENTS\040order\040by\040OPENTS\040limit\0401;
bnl@ibm2:~$ 

And now that one too.


I will move from this machine.

Thanks for the suggestions, both Tom and Adrian

I will keep the machine if you are interested of pursuing it,
Otherwise I’ll stop his thread.
That is, I am convinced enough that mixing versions combined with perhaps old hardware
together did something strange

--
Björn Lundin
b.f.lundin@gmail.com

view thread (6+ messages)  latest in thread

Message-ID: <D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com>
Permalink:  ../D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com/
Also on:    postgresql.org/message-id/D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: b.f.lundin@gmail.com, tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com
  Subject: Re: Order by and timestamp SOLVED
  In-Reply-To: <D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com>
  References: <63004F55-4CA3-40F8-A898-E7A646B0EBD3@gmail.com> <c171c26b-fd5e-b4bf-ec86-97b6f8dbcbe0@aklaver.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> <B8742026-DBCA-475E-9036-65C61DA2639B@gmail.com> <5e1a2f75-2d9c-889b-7504-63edb615caf6@aklaver.com> <33EA1F8F-5B37-41DD-B045-88FC8D207AC6@gmail.com> <1776fcbe-d55a-2059-7abf-0a615896a871@aklaver.com> <5E2FF59B-3E85-42C8-9C83-FED22A337695@gmail.com> <31986.1584453901@sss.pgh.pa.us> <D8821A25-7CF2-44BD-8001-B985591C6F8D@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox