PostgreSQL – Storing Unicode Characters is Easy

SQL
No Comments

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.

PostgreSQL - Storing Unicode Characters is Easy unicodepostgresql

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

PostgreSQL - Storing Unicode Characters is Easy pg_varchar_result

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.

Reference: Pinal Dave (https://blog.sqlauthority.com)

, , ,
Previous Post
SQL SERVER – New Parallel Operation Cannot be Started Due to Too Many Parallel Operations Executing at this Time
Next Post
Why is SQL Server Consolidation Better Than Having a Scattered Environment?

Related Posts

Leave a Reply

Menu