Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use nvarchar data type in plpgsql?

Tags:

postgresql

Can I use nvarchar data type in plpgsql?

If so, do I have to follow the same syntax?

If not, then what is the alternative?

like image 859
Sarfaraz Mak Avatar asked Dec 01 '22 16:12

Sarfaraz Mak


1 Answers

Just use the text or varchar types.

There's no need for, or support for, nvarchar. All PostgreSQL text-like types are always in the database's text encoding, you can't choose a 1-byte or 2-byte type like in MS SQL Server. Generally you just use a UTF-8 encoded DB, and everything works with no hassle.

like image 181
Craig Ringer Avatar answered Dec 28 '22 09:12

Craig Ringer