David Vielhuber
David Vielhuber

Reputation: 3569

PostgreSQL: varchar(1) and Umlaut

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.

Thanks for your help!

Upvotes: 0

Views: 486

Answers (1)

David Vielhuber
David Vielhuber

Reputation: 3569

Easy fix:

The encoding of the target database was wrong and had to be set to UTF8.

Upvotes: 2

Related Questions