Re: nvarchar notation accepted?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: nvarchar notation accepted?
Дата
Msg-id 13387.1273809138@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: nvarchar notation accepted?  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: nvarchar notation accepted?  (Jaime Casanova <jaime@2ndquadrant.com>)
Re: nvarchar notation accepted?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp> writes:
> Jaime Casanova <jaime@2ndquadrant.com> wrote:
>> i migrate a ms sql server database to postgres and was trying some
>> queries from the application to find if everything works right...
>> when i was looking to those queries i found some that has a notation
>> for nvarchar (ej: campo = N'sometext')

> Do you have documentation for N'...' literal in SQLServer?
> Does it mean unicode literal? What is the difference from U& literal?
> http://developer.postgresql.org/pgdocs/postgres/sql-syntax-lexical.html

> PostgreSQL doesn't have nvarchar types (UTF16 in MSSQL), and only
> have mutlti-tyte characters. So I think you can remove N and just
> use "SET client_encoding = UTF8" in the cases.

Actually, the lexer translates N'foo' to NCHAR 'foo' and then the
grammar treats that just like CHAR 'foo'.  In short, the N doesn't do
anything very useful, and it certainly doesn't have any effect on
encoding behavior.  I think this is something Tom Lockhart put in ten or
so years back, and never got as far as making it actually do anything
helpful.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: List traffic
Следующее
От: Jaime Casanova
Дата:
Сообщение: Re: nvarchar notation accepted?