BUG #16789: Wrong order by output

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: pmanousis(at)gmail(dot)com
Subject: BUG #16789: Wrong order by output
Date: 2020-12-22 20:06:09
Message-ID: 16789-087fbcd35ba8d334@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16789
Logged by: Petros Manousis
Email address: pmanousis(at)gmail(dot)com
PostgreSQL version: 13.1
Operating system: Linux (OpenSuse TumbleWeed)
Description:

I also tried my data in http://sqlfiddle.com/#!17/55afc5/3 with version 9.6
of postgres and the issue seems to be there too.

Here is my example:
create table players ( name varchar(64), url varchar(256), primary key
(name));
insert into players values('Theo Akwuba', 'a');
insert into players values('Theo Bouteille', 'b');
insert into players values('Theodor Dlugos', 'c');
insert into players values('Theodor Kirov', 'd');
insert into players values('Theodoros Tsiloulis', 'e');
insert into players values('Theodoros Zaras', 'f');
insert into players values('Theo John', 'g');
insert into players values('Theo Leon', 'h');
insert into players values('Theo Magrit', 'i');
insert into players values('Theo Maledon', 'j');
insert into players values('Theo Pinson', 'k');
insert into players values('Theo Rey', 'l');
SELECT name from players ORDER BY name ;

I would expect as result the following:
Theo Akwuba
Theo Bouteille
Theo John
Theo Leon
Theo Magrit
Theo Maledon
Theo Pinson
Theo Rey
Theodor Dlugos
Theodor Kirov
Theodoros Tsiloulis
Theodoros Zaras

BUT what I got is this:
Theo Akwuba
Theo Bouteille
Theodor Dlugos
Theodor Kirov
Theodoros Tsiloulis
Theodoros Zaras
Theo John
Theo Leon
Theo Magrit
Theo Maledon
Theo Pinson
Theo Rey

I don't know if there is anything specific to do for having a proper ordered
output, but the result seems wrong to me. I also tried the same query in
sqlite and had no issues, as well as with libreoffice sorting and all was as
expected.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Першин Юрий Петрович 2020-12-22 20:18:45 RE: BUG #16787: ODBC driver (libpq.dll, psqlodbc30a.dll, psqlodbc30w.dll) issues
Previous Message Tom Lane 2020-12-22 18:48:56 Re: BUG #16785: Postgresql shutdown during initial pg_prewarm prewarming causes Pg to get stuck