Does Postgresql varchar count using unicode character length or ASCII character length?

前端 未结 2 411
野性不改
野性不改 2020-12-31 00:09

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

2条回答
  •  旧巷少年郎
    2020-12-31 01:10

    It depends what value you used when you created the database. createdb -E UNICODE creates a Unicode DB that should also accept multibyte characters and count them as one character.

    You can use

    psql -l
    

    to see which encoding was used. This page has a table including information about how many bytes per character are used.

提交回复
热议问题