Порядок Postgres по неверному результату:
postgres=# SELECT (url) FROM posts_post ORDER BY url;
url
--------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
http://nautil.us/issue/70/variables/aging-is-a-communication-breakdown
https://github.com/felixse/FluentTerminal
http://www.bbc.com/future/story/20160408-the-ancient-peruvian-mystery-solved-from-space
http://www.graffathon.fi/2016/presentations/additive_slides.pdf
(4 rows)
Как вы видите, существует проблема с "http://nautil.us/issue/70/variables/aging-is-a-communication-breakdown".. Неправильная сортировка.
Iсохранил проанализированный результат в Postgres, используя Python и psycopg2, и пришел к точке, где я не могу проверить сортировку, потому что Postgres возвращал заказ с ошибками.
UPD: REPRODUCE:
CREATE TABLE test_post ("id" serial NOT NULL PRIMARY KEY, "title" text NOT NULL, "url" text NOT NULL, "created" timestamp with time zone NOT NULL);
INSERT INTO test_post (title, url, created) VALUES ('Aging Is', 'http://nautil.us/issue/70/variables/aging-is-a-communication-breakdown', NOW()) ON CONFLICT DO NOTHING;
INSERT INTO test_post (title, url, created) VALUES ('Untrusted – a user', 'https://github.com/felixse/FluentTerminal', NOW()) ON CONFLICT DO NOTHING;
INSERT INTO test_post (title, url, created) VALUES ('Artyping (1939)', 'http://www.bbc.com/future/story/20160408-the-ancient-peruvian-mystery-solved-from-space', NOW()) ON CONFLICT DO NOTHING;
INSERT INTO test_post (title, url, created) VALUES (' Applying the Universal', 'http://www.graffathon.fi/2016/presentations/additive_slides.pdf', NOW()) ON CONFLICT DO NOTHING;
SELECT (url) FROM test_post ORDER BY url;
PostgreSQL 11.2 (Debian 11.2-1.pgdg90 + 1) на x86_64-pc-linux-gnu, скомпилированный gcc (Debian 6.3.0-18 + deb9u 1) 6.3.0 20170516, 64-битный