Does Postgresql varchar count using unicode character length or ASCII character length?
- by bennylope
I tried importing a database dump from a SQL file and the insert failed when inserting the string Mér into a field defined as varying(3). I didn't capture the exact error, but it pointed to that specific value with the constraint of varying(3).
Given that I considered this unimportant to what I was doing at the time, I just changed the value to Mer, it worked, and I moved on.
Is a varying field with its limit taking into account length of the byte string? What really boggles my mind is that this was dumped from another PostgreSQL database. So it doesn't make sense how a constraint could allow the value to be written initially.