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

[YSQL] LC_CTYPE = 'C' support #13863

Open
philtreF opened this issue Sep 4, 2022 · 3 comments
Open

[YSQL] LC_CTYPE = 'C' support #13863

philtreF opened this issue Sep 4, 2022 · 3 comments
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@philtreF
Copy link

philtreF commented Sep 4, 2022

Jira Link: DB-3424

Description

Hi,

I wanted to deploy a Matrix Synapse server on Yugabyte.
As explained on this page this software needs LC_CTYPE = 'C' like on this example :

postgresserver=#  \l
                                 List of databases
   Name    |  Owner   | Encoding |  Collate   |   Ctype    |   Access privileges   
-----------+----------+----------+------------+------------+-----------------------
 synapse   | synapse  | UTF8     | C          | C          | 

However when I try to create this kind of database I got this error :

yugabyte=# CREATE DATABASE synapse2 WITH OWNER = synapse TEMPLATE='template0' ENCODING='UTF-8' LC_CTYPE='C';
ERROR:  Value other than 'en_US.UTF-8' for lc_ctype option is not yet supported
LINE 1: ...R = synapse TEMPLATE='template0' ENCODING='UTF-8' LC_CTYPE='...

Devs are specific on the fact that this is mandatory to avoid database corruption source
Quote :

allow_unsafe_locale is an option specific to Postgres. Under the default behavior, Synapse will refuse to start if the postgres db is set to a non-C locale. You can override this behavior (which is not recommended) by setting allow_unsafe_locale to true. Note that doing so may corrupt your database.

I am not sure about the difference on the backend for you. Is that a planned feature to implement ? Does this make sense ?

Fred

@ddorian
Copy link
Contributor

ddorian commented Sep 8, 2022

allow_unsafe_locale is an option specific to Postgres. Under the default behavior, Synapse will refuse to start if the postgres db is set to a non-C locale. You can override this behavior (which is not recommended) by setting allow_unsafe_locale to true. Note that doing so may corrupt your database.

Note that this should work in our case, there's no risk of db corruption.

@tverona1 tverona1 added the area/ysql Yugabyte SQL (YSQL) label Sep 8, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Sep 8, 2022
@philtreF
Copy link
Author

philtreF commented Sep 10, 2022

Thanks @ddorian for your answer. I understood this should not lead me to corrupt the database. Can you explain me why you think this (link, source code, etc) ?
Do you know if this LC_CTYPE = 'C' will be implemented soon in Yugabyte?

@ddorian
Copy link
Contributor

ddorian commented Sep 12, 2022

I understood this should not lead me to corrupt the database. Can you explain me why you think this (link, source code, etc) ?

I think they should explain why it may lead to corruption (the exact scenario).

And we can see how/if it applies to us.

Steps to reproduce

have DB use wrong locale
update libc with locale change
notice corrupt DB

I don't think this will apply to us. cc @m-iancu

Do you know if this LC_CTYPE = 'C' will be implemented soon in Yugabyte?

It's not on the near-term roadmap https://github.com/yugabyte/yugabyte-db#current-roadmap

@yugabyte-ci yugabyte-ci added the status/awaiting-triage Issue awaiting triage label Sep 14, 2022
@yugabyte-ci yugabyte-ci removed the status/awaiting-triage Issue awaiting triage label Sep 28, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/new-feature This is a request for a completely new feature labels Oct 12, 2022
@yugabyte-ci yugabyte-ci changed the title [New Feature] LC_CTYPE = 'C' support [YSQL] LC_CTYPE = 'C' support Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

4 participants