Re: [PATCH] docs: document N'...' national character string literal syntax - Mailing list pgsql-docs

From Erik Wienhold
Subject Re: [PATCH] docs: document N'...' national character string literal syntax
Date
Msg-id f88306cc-1cd9-4727-ab94-5b8bcdb89b11@ewie.name
Whole thread Raw
In response to Re: [PATCH] docs: document N'...' national character string literal syntax  (Hoda Salim <hoda.s.salim@gmail.com>)
Responses Re: [PATCH] docs: document N'...' national character string literal syntax
List pgsql-docs
On 2026-02-02 21:04 +0100, Hoda Salim wrote:
> > nchar is an alias of bpchar.  There's no cast to char behind the scenes
> > since that would truncate the string:
> >
> >         select n'foo', 'foo'::character;
> >          bpchar | bpchar
> >         --------+--------
> >          foo    | f
> >         (1 row)
> 
> Thank you for catching this! I verified the behavior and updated the
> documentation to correctly state that N'...' is equivalent to a bpchar
> literal.

Thanks!  The text looks good now.  But please fix the indentation of the
second paragraph (should be one space per level).  Your first patch was
correct in that regard.

> > Should we also mention the nchar alias in [4]?
> > [4] https://www.postgresql.org/docs/current/datatype-character.html
> 
> I'm happy to add that in a v3 if you think it belongs in this patch.
> I wasn't sure if it would be preferred separately or together.

I'd prefer a single patch with both changes to have an atomic change.
But in the end it's up to the committer, not me.

--
Erik Wienhold



pgsql-docs by date:

Previous
From: Hoda Salim
Date:
Subject: Re: [PATCH] docs: document N'...' national character string literal syntax
Next
From: "David G. Johnston"
Date:
Subject: Re: [PATCH] docs: document N'...' national character string literal syntax