Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
giangpham712 opened this issue Aug 12, 2023 · 3 comments
Open
Labels
A-tools-efcore C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-triaged blathers was able to find an owner

Comments

@giangpham712
Copy link

giangpham712 commented Aug 12, 2023

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

@giangpham712 giangpham712 added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Aug 12, 2023
@blathers-crl
Copy link

blathers-crl bot commented Aug 12, 2023

Hello, I am Blathers. I am here to help you get the issue triaged.

Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here.

I have CC'd a few people who may be able to assist you:

  • @cockroachdb/sql-foundations (found keywords: pg_)

If we have not gotten back to your issue within a few business days, you can try the following:

  • Join our community slack channel and ask on #cockroachdb.
  • Try find someone from here if you know they worked closely on the area and CC them.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Aug 12, 2023
@fqazi fqazi self-assigned this Aug 17, 2023
@fqazi
Copy link
Collaborator

fqazi commented Aug 17, 2023

This requires some more complex work. The collation type is just not handled properly at:

if locale != collatedstring.DefaultCollationTag {

@fqazi fqazi removed their assignment Aug 17, 2023
@fqazi
Copy link
Collaborator

fqazi commented Aug 17, 2023

@giangpham712 Please skip tests declaring this column type for the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tools-efcore C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-community Originated from the community X-blathers-triaged blathers was able to find an owner
Projects
None yet
Development

No branches or pull requests

3 participants