Re: Equivalant of SQL Server's Nchar and NVARCHAR

From: Rob <pgadmin(at)itsbeen(dot)sent(dot)com>
To: kumar <sgnerd(at)yahoo(dot)com(dot)sg>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Equivalant of SQL Server's Nchar and NVARCHAR
Date: 2004-04-29 14:18:36
Message-ID: 40910EBC.1090807@itsbeen.sent.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

kumar wrote:

> Dear friends,
> Is there any equivalent datatype of SQL Server's NCHAR and NVARCHAR,
> available with Postgres 7.3.4. I want to store characters, special
> characters and Numbers.
> Please shed some light.
>
> Thanks
> Kumar

I only only use ascii but...
I believe postgresql varchar is the same as Oracle/Sybase/MS SQL
nvarchar even though it doesn't explicitly say so here:

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

Here is a short example:
create table
nvctest (
utf8fld varchar(12)
);
insert into nvctest
select convert('PostgreSQL' using ascii_to_utf_8);
select * from nvctest;

text functions including encoding conversions are here:

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

Good Luck,

Rob

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Roelant Ossewaarde 2004-04-29 16:41:06 Use arrays or not?
Previous Message Christoph Haller 2004-04-29 13:35:38 Re: Multi ordered select and indexing