pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Docker image of 11~beta2-2 orders strings case-insensitively
7+ messages / 4 participants
[nested] [flat]

* Docker image of 11~beta2-2 orders strings case-insensitively
@ 2018-08-06 14:56 Yahor Yuzefovich <yahor@cockroachlabs.com>
  2018-08-06 15:56 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Tom Lane <tgl@sss.pgh.pa.us>
  2018-08-06 16:03 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively David G. Johnston <david.g.johnston@gmail.com>
  2018-08-06 20:37 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Yahor Yuzefovich @ 2018-08-06 14:56 UTC (permalink / raw)
  To: pgsql-bugs

Hello,

I used these commands to run Beta PG 11:
docker pull postgres:11
docker run --name POSTGRES11 -e POSTGRES_PASSWORD=postgres -d postgres:11
docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres -U
postgres

I've created a table as follows:
CREATE TABLE t (id serial PRIMARY KEY, name VARCHAR (255) NOT NULL);
INSERT INTO t (name) VALUES ('M'), ('i'), ('A');

and ran this query:
SELECT name FROM t ORDER BY name;

I expected to see:
A
M
i

but found:
A
i
M

Best,
Yahor Yuzefovich

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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
@ 2018-08-06 15:56 ` Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2018-08-06 15:56 UTC (permalink / raw)
  To: Yahor Yuzefovich <yahor@cockroachlabs.com>; +Cc: pgsql-bugs

Yahor Yuzefovich <yahor@cockroachlabs.com> writes:
> I expected to see:
> A
> M
> i

> but found:
> A
> i
> M

That would be a matter of what collation you're running it under ...
if sort(1) sorts the same way, it's not a PG issue.

			regards, tom lane




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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
@ 2018-08-06 16:03 ` David G. Johnston <david.g.johnston@gmail.com>
  2018-08-06 19:30   ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
  2 siblings, 1 reply; 7+ messages in thread

From: David G. Johnston @ 2018-08-06 16:03 UTC (permalink / raw)
  To: Yahor Yuzefovich <yahor@cockroachlabs.com>; +Cc: pgsql-bugs

On Monday, August 6, 2018, Yahor Yuzefovich <yahor@cockroachlabs.com> wrote:

> Hello,
>
> I used these commands to run Beta PG 11:
> docker pull postgres:11
> docker run --name POSTGRES11 -e POSTGRES_PASSWORD=postgres -d postgres:11
> docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres
> -U postgres
>
> I've created a table as follows:
> CREATE TABLE t (id serial PRIMARY KEY, name VARCHAR (255) NOT NULL);
> INSERT INTO t (name) VALUES ('M'), ('i'), ('A');
>
> and ran this query:
> SELECT name FROM t ORDER BY name;
>
> I expected to see:
> A
> M
> i
>
> but found:
> A
> i
> M
>

This is an environmental aspect (locale) of the docker image; not a bug.  I
suggest posting on -general, with details about your locale settings, if
you would like some guidance in that area.

David J.

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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
  2018-08-06 16:03 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively David G. Johnston <david.g.johnston@gmail.com>
@ 2018-08-06 19:30   ` Yahor Yuzefovich <yahor@cockroachlabs.com>
  2018-08-06 20:34     ` Re: Docker image of 11~beta2-2 orders strings case-insensitively David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Yahor Yuzefovich @ 2018-08-06 19:30 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-bugs

Here is the output of running

docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres -U
postgres -l

                                 List of databases

   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access
privileges

-----------+----------+----------+------------+------------+-----------------------

 postgres  | postgres | UTF8     | en_US.utf8 | en_US.utf8 |

 template0 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres
      +

           |          |          |            |            |
postgres=CTc/postgres

 template1 | postgres | UTF8     | en_US.utf8 | en_US.utf8 | =c/postgres
      +

           |          |          |            |            |
postgres=CTc/postgres
I might be missing something, but it looks to me that I have regular
collation. Sorry, I don't have any experience with this.

Best,
Yahor Yuzefovich

On Mon, Aug 6, 2018 at 12:03 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

> On Monday, August 6, 2018, Yahor Yuzefovich <yahor@cockroachlabs.com>
> wrote:
>
>> Hello,
>>
>> I used these commands to run Beta PG 11:
>> docker pull postgres:11
>> docker run --name POSTGRES11 -e POSTGRES_PASSWORD=postgres -d postgres:11
>> docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres
>> -U postgres
>>
>> I've created a table as follows:
>> CREATE TABLE t (id serial PRIMARY KEY, name VARCHAR (255) NOT NULL);
>> INSERT INTO t (name) VALUES ('M'), ('i'), ('A');
>>
>> and ran this query:
>> SELECT name FROM t ORDER BY name;
>>
>> I expected to see:
>> A
>> M
>> i
>>
>> but found:
>> A
>> i
>> M
>>
>
> This is an environmental aspect (locale) of the docker image; not a bug.
> I suggest posting on -general, with details about your locale settings, if
> you would like some guidance in that area.
>
> David J.
>

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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
  2018-08-06 16:03 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively David G. Johnston <david.g.johnston@gmail.com>
  2018-08-06 19:30   ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
@ 2018-08-06 20:34     ` David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 7+ messages in thread

From: David G. Johnston @ 2018-08-06 20:34 UTC (permalink / raw)
  To: Yahor Yuzefovich <yahor@cockroachlabs.com>; +Cc: pgsql-bugs

On Mon, Aug 6, 2018 at 12:30 PM, Yahor Yuzefovich <yahor@cockroachlabs.com>
wrote:

> I might be missing something, but it looks to me that I have regular
> collation. Sorry, I don't have any experience with this.
>
The locale en_US.utf8 has the behavior you are observing.  You seem to be
familiar with the generic "C" locale which has the sorting behavior you are
expecting.

https://www.postgresql.org/docs/10/static/charset.html
David J.

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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
@ 2018-08-06 20:37 ` Alvaro Herrera <alvherre@2ndquadrant.com>
  2018-08-06 20:43   ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
  2 siblings, 1 reply; 7+ messages in thread

From: Alvaro Herrera @ 2018-08-06 20:37 UTC (permalink / raw)
  To: Yahor Yuzefovich <yahor@cockroachlabs.com>; +Cc: pgsql-bugs

On 2018-Aug-06, Yahor Yuzefovich wrote:

> and ran this query:
> SELECT name FROM t ORDER BY name;
> 
> I expected to see:
> A
> M
> i

alvherre=# SELECT name FROM t ORDER BY name COLLATE "C";
 name 
──────
 A
 M
 i
(3 filas)

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




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

* Re: Docker image of 11~beta2-2 orders strings case-insensitively
  2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
  2018-08-06 20:37 ` Re: Docker image of 11~beta2-2 orders strings case-insensitively Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2018-08-06 20:43   ` Yahor Yuzefovich <yahor@cockroachlabs.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Yahor Yuzefovich @ 2018-08-06 20:43 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-bugs

Thanks for the explanation. Sorry for the confusion.

Best,
Yahor Yuzefovich

On Mon, Aug 6, 2018 at 4:37 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
wrote:

> On 2018-Aug-06, Yahor Yuzefovich wrote:
>
> > and ran this query:
> > SELECT name FROM t ORDER BY name;
> >
> > I expected to see:
> > A
> > M
> > i
>
> alvherre=# SELECT name FROM t ORDER BY name COLLATE "C";
>  name
> ──────
>  A
>  M
>  i
> (3 filas)
>
> --
> Álvaro Herrera                https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

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


end of thread, other threads:[~2018-08-06 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06 14:56 Docker image of 11~beta2-2 orders strings case-insensitively Yahor Yuzefovich <yahor@cockroachlabs.com>
2018-08-06 15:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-08-06 16:03 ` David G. Johnston <david.g.johnston@gmail.com>
2018-08-06 19:30   ` Yahor Yuzefovich <yahor@cockroachlabs.com>
2018-08-06 20:34     ` David G. Johnston <david.g.johnston@gmail.com>
2018-08-06 20:37 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2018-08-06 20:43   ` Yahor Yuzefovich <yahor@cockroachlabs.com>

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