pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feeddatabase collation "C" and "C.LATIN1"
6+ messages / 3 participants
[nested] [flat]
* database collation "C" and "C.LATIN1"
@ 2023-03-09 08:22 James Pang (chaolpan) <chaolpan@cisco.com>
0 siblings, 1 reply; 6+ messages in thread
From: James Pang (chaolpan) @ 2023-03-09 08:22 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Hi,
We create one database with collate= "C.LATIN1", any difference between "C" and "C.LATIN1" ? database encoding is "LATIN1".
oid | collname | collnamespace | collowner | collprovider | collisdeterministic | collencoding | collcollate | collctype | collv
ersion
-------+------------------------+---------------+-----------+--------------+---------------------+--------------+------------------+------------------+------
-------
950 | C | 11 | 10 | c | t | -1 | C | C |
12328 | C.latin1 | 11 | 10 | c | t | 8 | C.latin1 | C.latin1
Thanks,
James
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database collation "C" and "C.LATIN1"
@ 2023-03-09 08:29 Laurenz Albe <laurenz.albe@cybertec.at>
parent: James Pang (chaolpan) <chaolpan@cisco.com>
0 siblings, 2 replies; 6+ messages in thread
From: Laurenz Albe @ 2023-03-09 08:29 UTC (permalink / raw)
To: James Pang (chaolpan) <chaolpan@cisco.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Thu, 2023-03-09 at 08:22 +0000, James Pang (chaolpan) wrote:
> We create one database with collate= “C.LATIN1”, any difference between “C” and “C.LATIN1” ?
> database encoding is “LATIN1”.
>
> oid | collname | collencoding | collcollate | collctype | collversion
> -------+------------------------+--------------+------------------+------------------+-------------
> 950 | C | -1 | C | C |
> 12328 | C.latin1 | 8 | C.latin1 | C.latin1 |
The difference is a technicality: "C" is encoding agnostic (-1) and can be used with
any encoding, while "C.latin1" can only be used with encoding LATIN1 (8).
The behavior is the same.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: database collation "C" and "C.LATIN1"
@ 2023-03-09 08:31 James Pang (chaolpan) <chaolpan@cisco.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 0 replies; 6+ messages in thread
From: James Pang (chaolpan) @ 2023-03-09 08:31 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
The sorting order behavior is same ,right?
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, March 9, 2023 4:30 PM
To: James Pang (chaolpan) <chaolpan@cisco.com>; pgsql-admin@lists.postgresql.org
Subject: Re: database collation "C" and "C.LATIN1"
On Thu, 2023-03-09 at 08:22 +0000, James Pang (chaolpan) wrote:
> We create one database with collate= “C.LATIN1”, any difference between “C” and “C.LATIN1” ?
> database encoding is “LATIN1”.
>
> oid | collname | collencoding | collcollate |
> collctype | collversion
> -------+------------------------+--------------+------------------+------------------+-------------
> 950 | C | -1 | C | C |
> 12328 | C.latin1 | 8 | C.latin1 | C.latin1 |
The difference is a technicality: "C" is encoding agnostic (-1) and can be used with any encoding, while "C.latin1" can only be used with encoding LATIN1 (8).
The behavior is the same.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 6+ messages in thread
* RE: database collation "C" and "C.LATIN1"
@ 2023-03-09 08:37 James Pang (chaolpan) <chaolpan@cisco.com>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 1 reply; 6+ messages in thread
From: James Pang (chaolpan) @ 2023-03-09 08:37 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Both follow "C" collate behavior ,right?
-----Original Message-----
From: Laurenz Albe <laurenz.albe@cybertec.at>
Sent: Thursday, March 9, 2023 4:30 PM
To: James Pang (chaolpan) <chaolpan@cisco.com>; pgsql-admin@lists.postgresql.org
Subject: Re: database collation "C" and "C.LATIN1"
On Thu, 2023-03-09 at 08:22 +0000, James Pang (chaolpan) wrote:
> We create one database with collate= “C.LATIN1”, any difference between “C” and “C.LATIN1” ?
> database encoding is “LATIN1”.
>
> oid | collname | collencoding | collcollate |
> collctype | collversion
> -------+------------------------+--------------+------------------+------------------+-------------
> 950 | C | -1 | C | C |
> 12328 | C.latin1 | 8 | C.latin1 | C.latin1 |
The difference is a technicality: "C" is encoding agnostic (-1) and can be used with any encoding, while "C.latin1" can only be used with encoding LATIN1 (8).
The behavior is the same.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database collation "C" and "C.LATIN1"
@ 2023-03-09 12:04 Laurenz Albe <laurenz.albe@cybertec.at>
parent: James Pang (chaolpan) <chaolpan@cisco.com>
0 siblings, 1 reply; 6+ messages in thread
From: Laurenz Albe @ 2023-03-09 12:04 UTC (permalink / raw)
To: James Pang (chaolpan) <chaolpan@cisco.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
On Thu, 2023-03-09 at 08:37 +0000, James Pang (chaolpan) wrote:
> Both follow "C" collate behavior ,right?
Right.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: database collation "C" and "C.LATIN1"
@ 2023-03-09 14:35 Tom Lane <tgl@sss.pgh.pa.us>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2023-03-09 14:35 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: James Pang (chaolpan) <chaolpan@cisco.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Thu, 2023-03-09 at 08:37 +0000, James Pang (chaolpan) wrote:
>> Both follow "C" collate behavior ,right?
> Right.
There is another difference: "C" is a built-in collation, while
"C.latin1" must have been something that initdb made because
"locale -a" claimed it exists on your platform. Postgres has
some optimizations built in for "C" (and its equivalent "POSIX")
that will not apply for "C.latin1". So while they should be
behaviorally the same, "C.latin1" is likely to be slower.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-03-09 14:35 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 08:22 database collation "C" and "C.LATIN1" James Pang (chaolpan) <chaolpan@cisco.com>
2023-03-09 08:29 ` Laurenz Albe <laurenz.albe@cybertec.at>
2023-03-09 08:31 ` James Pang (chaolpan) <chaolpan@cisco.com>
2023-03-09 08:37 ` James Pang (chaolpan) <chaolpan@cisco.com>
2023-03-09 12:04 ` Laurenz Albe <laurenz.albe@cybertec.at>
2023-03-09 14:35 ` Re: database collation "C" and "C.LATIN1" 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