cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.12k stars 3.81k forks source link

sql: collation using pg_catalog.default does not work #123939

Open fqazi opened 6 months ago

fqazi commented 6 months ago

Currently CRDB does not support the builtin collation pg_catalog.default, which makes it incompatible with PostgresSQL. For example we support the following:

select 'a' < ('foo' COLLATE default);

but on Postgres the following is valid syntax as well.

select 'a' < ('foo' COLLATE pg_catalog.default);

Jira issue: CRDB-38613

rafiss commented 6 months ago

We might need to update the syntax rule for collation names here: https://github.com/cockroachdb/cockroach/blob/c1828e71175a0406380c8295ec23cd71d295621d/pkg/sql/parser/sql.y#L16721

marksoper commented 6 months ago

Also part of the original customer feedback: the original SQL that was not working was generated by the \d <table_or_view_name> command. So the customer is not just saying "hey this SQL doesn't work", but also "why does the describe command produce SQL that doesn't work".