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

Add collation support to relevant data types (new types or enhance existing) #685

Open
jacques-n opened this issue Aug 19, 2024 · 0 comments

Comments

@jacques-n
Copy link
Contributor

We need to solve collation. Because collation can different on different fields/literals (e.g. a table with two columns of different collation or two tables with different collations), I propose that we add collation as a property of the string data types. There are three main string data types:

  • STRING
  • VARCHAR
  • FIXEDCHAR

It seems like we have two options for how to introduce collation:

  1. introduce 3 new types that include a collation property
  2. enhance existing types so they have collation properties but are backwards compatible to avoid migration pain.

I suggest we do the second option. I think this would lead to having a new way to express compound types with default options. For example, maybe we say the following would both be legal:

string => a string type with default collation
string<af_na> => a string type with [af_na collation](https://www.localeplanet.com/icu/af-NA/index.html)

I propose we use the ICU locale names to reference collations with the addition of a pseudo collation called binary. Binary would be the default collation if a parameter is not given.

In function definitions I would be inclined to say that if an argument is specified without a collation, the function applies to all collations (as opposed to what might be interpreted as only the binary collation). This means that string in a plan would mean something slightly different than string in an extension but I think the benefits of backwards compatibility and likely expected behavior would be best with this compromise.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant