What Is The PostgreSQL Equivalent To SQL Server NVARCHAR?

I’m pretty sure postgres varchar is the same as Oracle/Sybase/MSSQL nvarchar even though it is not explicit in the manual:

http://www.postgresql.org/docs/7.4/static/datatype-character.html

Encoding conversion functions are here:

http://www.postgresql.org/docs/current/static/functions-string.html
http://www.postgresql.org/docs/current/static/functions-string.html#CONVERSION-NAMES

Example:

create table
nvctest (
utf8fld varchar(12)
);
insert into nvctest
select convert('PostgreSQL' using ascii_to_utf_8);
select * from nvctest;

Also, there is this response to a similar question from a Postgresql rep:

All of our TEXT datatypes are
multibyte-capable, provided you’ve
installed PostgreSQL correctly.
This includes: TEXT (recommended)
VARCHAR CHAR

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)