One of the interesting features of PostgreSQL database is the ability to handle Unicode characters. In SQL Server, to store non-English characters, we need to use NVARCHAR or NCAHR data type. In PostgreSQL, the varchar data type itself will store both English and non-English characters.
Let us explore this with the following example. Create a table in PostgreSQL database as shown below
CREATE TABLE TESTING1(COL VARCHAR(100))
INSERT INTO TESTING1 (COL) SELECT 'ЯНВАРЬ'
The above example adds a string of Russian characters (It means January in English)
Now let us SELECT the column value and see what it returns
SELECT COL FROM TESTING1
The result is
As you see, with just varchar data type, the PostgreSQL engine is able to store multi-language characters without any additional approaches
Also, read this post to know how to add multi-language characters in the SQL Server Engine SQL SERVER – Storing Data in Hindi, Chinese, Gujarati, and Tamil (or any other) Language in the Same Table
Let me know if any other Database Engine has this type of feature, I will be happy to learn from you and post on this blog with due credit to you.
Here are few of the blog post I wrote earlier about PostgreSQL.
- PostgreSQL – Learn Online in a Single Day – PostgreSQL Learning Path
- POSTGRESQL – How to Create a Function? – How to Declare Local Variable
- SQL – Difference between != and <> Operator used for NOT EQUAL TO Operation
Reference: Pinal Dave (https://blog.sqlauthority.com)
First appeared on PostgreSQL – Storing Unicode Characters is Easy