pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15919: When sorting, does the result show that S > s is correct?
2+ messages / 2 participants
[nested] [flat]

* BUG #15919: When sorting, does the result show that S > s is correct?
@ 2019-07-19 11:48  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2019-07-19 11:48 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: 1726002692@qq.com

The following bug has been logged on the website:

Bug reference:      15919
Logged by:          强 魏
Email address:      1726002692@qq.com
PostgreSQL version: 11.4
Operating system:   CentOS Linux release 7.6.1810 (Core)
Description:        

postgres@[local]:5433[postgres]#select * from t order by info desc;
+------+
| info |
+------+
| S    |
| s    |
+------+
(2 rows)

Time: 0.718 ms
postgres@[local]:5433[postgres]#select * from t order by info asc;
+------+
| info |
+------+
| s    |
| S    |
+------+
(2 rows)

Time: 0.789 ms
postgres@[local]:5433[postgres]#select ascii('s') AS "s",ascii('S') AS
"S";
+-----+----+
|  s  | S  |
+-----+----+
| 115 | 83 |
+-----+----+
(1 row)

Time: 0.381 ms
postgres@[local]:5433[postgres]#show lc_collate 
postgres-# ;
+-------------+
| lc_collate  |
+-------------+
| en_US.UTF-8 |
+-------------+
(1 row)

Time: 0.407 ms



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #15919: When sorting, does the result show that S > s is correct?
@ 2019-07-19 14:16  Tom Lane <tgl@sss.pgh.pa.us>
  parent: PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-07-19 14:16 UTC (permalink / raw)
  To: 1726002692@qq.com; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> postgres@[local]:5433[postgres]#select * from t order by info asc;
> +------+
> | info |
> +------+
> | s    |
> | S    |
> +------+
> (2 rows)

This is the expected behavior for en_US locale, as you can easily
confirm outside of Postgres:

$ (echo s; echo S) | LANG=en_US sort
s
S

Perhaps you are confusing it with C locale?

$ (echo s; echo S) | LANG=C sort
S
s

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-07-19 14:16 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-19 11:48 BUG #15919: When sorting, does the result show that S > s is correct? PG Bug reporting form <noreply@postgresql.org>
2019-07-19 14:16 ` Tom Lane <tgl@sss.pgh.pa.us>

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