N
Neon16mo ago
conscious-sapphire

DB Locale

Hi, I encountered an issue when restoring database dump into neon, fails with
ERROR: ltree syntax error at character 12
CONTEXT: COPY tablename, line 17, column name: "ü"
ERROR: ltree syntax error at character 12
CONTEXT: COPY tablename, line 17, column name: "ü"
the LC_COLLATE of the DB that created the dump is en_US.UTF8 (default in cloud SQL) will you support different locales at some point (I assume that's the issue), or is there any way to workaround?
5 Replies
stormy-gold
stormy-gold16mo ago
Hey @molek, Create a database with desired encoding: create database russian_icu_db icu_locale 'ru-x-icu' locale_provider='icu' template template0; Does that help?
conscious-sapphire
conscious-sapphireOP16mo ago
hey @Rishi Raj Jain nope, I've tried that
ambitious-aqua
ambitious-aqua16mo ago
Neon doesnt currently support directly changing the db encoding, however you may be able to use ICU custom collations to make it work: https://neon.tech/docs/reference/compatibility#database-encoding CREATE COLLATION russian (provider = icu, locale = 'ru'); CREATE TABLE books (id int, title text COLLATE "russian"); ah wait a sec - there's some internal discussion of a better way to do it.
stormy-gold
stormy-gold16mo ago
did you get a chance at the command I shared? does that work for you?
optimistic-gold
optimistic-gold16mo ago
By default, a Neon database is created with the C locale, and I see this in the ltree docs: "Valid alphanumeric character ranges are dependent on the database locale. For example, in C locale, the characters A-Za-z0-9_- are allowed." A possible solution, if creating the targetdb with a ICU ru locale doesn't work, might be to rename columns before dumping using the supported characters mentioned above.

Did you find this page helpful?