Reputation: 3569
I have a VARCHAR(1)
field in postgresql.
Now I export data from a postgresql 9.4 server with pg_dump
and import it to a postgresql 9.5 server with pgsql.
When I import it, I get an error:
ERROR: value too long for type character varying(1) COPY XXX "Ö"
That means in the table there is the value "Ö"
which takes 2 bytes instead of 1 byte.
Must I increase the column to VARCHAR(2)
?
Is there another way to keep VARCHAR(1)
and use a locale etc.?
Why could this data ever be stored there?
Thanks for your help!
Upvotes: 0
Views: 486
Reputation: 3569
Easy fix:
The encoding of the target database was wrong and had to be set to UTF8.
Upvotes: 2