Re: nvarchar notation accepted? - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: nvarchar notation accepted?
Date
Msg-id AANLkTilaCHIQbz3fcDN-51uqK81d1NjkDmPH7re6Qiz3@mail.gmail.com
Whole thread Raw
In response to Re: nvarchar notation accepted?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: nvarchar notation accepted?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Thu, May 13, 2010 at 11:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jaime Casanova <jaime@2ndquadrant.com> writes:
>> On Thu, May 13, 2010 at 10:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> 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.
>
>> so, the N'' syntax is fine and i don't need to hunt them as a migration step?
>
> As long as the implied cast to char(n) doesn't cause you problems, it's
> fine.
>

Is this something we want to document? Maybe something like:
"""
For historical reasons N'' syntax is also accepted as a string literal.
"""

or we can even mention the fact that that is useful for sql server migrations?

--
Jaime Casanova         www.2ndQuadrant.com
Soporte y capacitación de PostgreSQL


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] Fix leaky VIEWs for RLS
Next
From: Stephen Frost
Date:
Subject: Re: [PATCH] Fix leaky VIEWs for RLS