Re: [PATCH] docs: document N'...' national character string literal syntax

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Hoda Salim <hoda(dot)s(dot)salim(at)gmail(dot)com>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] docs: document N'...' national character string literal syntax
Date: 2026-02-04 00:24:34
Message-ID: f88306cc-1cd9-4727-ab94-5b8bcdb89b11@ewie.name
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2026-02-04 01:31:36 Re: [PATCH] docs: document N'...' national character string literal syntax
Previous Message Hoda Salim 2026-02-02 20:04:12 Re: [PATCH] docs: document N'...' national character string literal syntax