cockroachdb / cockroachdb/cockroach

sql: syntax error: invalid locale POSIX: language: tag is not well-formed

Open
#108,657 4 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat A-tools-efcore C-bug O-community T-sql-foundations X-blathers-triaged
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

Trying to create a table using the following SQL:

```
CREATE TABLE columns_with_collation (
id int,
default_collation TEXT,
non_default_collation TEXT COLLATE "POSIX"
);
```

returns error

```
ERROR: at or near ")": syntax error: invalid locale POSIX: language: tag is not well-formed
```

The following query

```
SELECT collname from pg_catalog.pg_collation;
```

shows POSIX as an available collation

```
oid | collname | collnamespace | collowner | collencoding | collcollate | collctype | collprovider | collversion | collisdeterministic
-------------+---------------------+---------------+-----------+--------------+-------------+-----------+--------------+-------------+----------------------
3403232968 | default | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
125208652 | C | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
1091284106 | POSIX | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
194813764 | und | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
764986699 | aa | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
764986700 | af | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
764986712 | ar | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
764986713 | as | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
764986704 | az | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
748209138 | be | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
748209136 | bg | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
748209145 | bn | 4294967114 | NULL | 6 | NULL | NULL | NULL | NULL | NULL
...
```

**Additional context**
This affects efcore.pg tests

@fqazi

Jira issue: CRDB-30569

Epic CRDB-60815

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.