Murtuza Z
Murtuza Z

Reputation: 6017

Not able to create Collation on windows

Hi I am trying to create collation on Windows but not able to create it, I getting error as shown in screenshot.

enter image description here

enter image description here

I am using deafult POSIX collation to create new collation,

Here on Postgres website, It is mentioned that POSIX is available in all platform.

https://www.postgresql.org/docs/9.4/static/collation.html

On all platforms, the collations named default, C, and POSIX are available. Additional collations may be available depending on operating system support. The default collation selects the LC_COLLATE and LC_CTYPE values specified at database creation time. The C and POSIX collations both specify "traditional C" behavior, in which only the ASCII letters "A" through "Z" are treated as letters, and sorting is done strictly by character code byte values.

Can anyone tell me the reason for this error?

Upvotes: 0

Views: 581

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 248125

That is unexpected and could be seen as a bug, you might want to report it.

The underlying problem is that Windows does not know a locale POSIX. What is surprising here is that the pre-existing collation POSIX has POSIX set as LC_COLLATE and LC_CTYPE even though they do not exist.

However, you can easily work around the problem since collation C is the same as POSIX:

CREATE COLLATION test FROM pg_catalog."C";

Upvotes: 1

Related Questions