Does Postgresql varchar count using unicode character length or ASCII character length?
Posted
by
bennylope
on Stack Overflow
See other posts from Stack Overflow
or by bennylope
Published on 2010-11-22T20:07:53Z
Indexed on
2011/03/15
16:10 UTC
Read the original article
Hit count: 204
postgresql
|unicode
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.
© Stack Overflow or respective owner