Thread: Docker image of 11~beta2-2 orders strings case-insensitively
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
Hello,I used these commands to run Beta PG 11:docker pull postgres:11docker run --name POSTGRES11 -e POSTGRES_PASSWORD=postgres -d postgres:11docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres -U postgresI'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:AMibut found:AiM
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.
On Monday, August 6, 2018, Yahor Yuzefovich <yahor@cockroachlabs.com> wrote:Hello,I used these commands to run Beta PG 11:docker pull postgres:11docker run --name POSTGRES11 -e POSTGRES_PASSWORD=postgres -d postgres:11docker run -it --rm --link POSTGRES11:postgres postgres psql -h postgres -U postgresI'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:AMibut found:AiMThis 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.
I might be missing something, but it looks to me that I have regular collation. Sorry, I don't have any experience with this.
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
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