Re: Support for \u0000?

From: Matthew Byrne <mjw(dot)byrne(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Support for \u0000?
Date: 2017-07-19 22:21:58
Message-ID: CAE37PpPmsY1DLP1kcghQw6Qv5zZjdUKdGORjRM84u_Kbnd=Z2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for the response Tom. I understand this would be a mammoth task.

Would a more feasible approach be to introduce new types (say, TEXT2 and
JSONB2 - or something better-sounding) which are the same as the old ones
but add for support \u0000 and UTF 0? This would isolate nul-containing
byte arrays to the implementations of those types and keep backward
compatibility by leaving TEXT and JSONB alone.

Matt

On Wed, Jul 19, 2017 at 7:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Matthew Byrne <mjw(dot)byrne(at)gmail(dot)com> writes:
> > Are there any plans to support \u0000 in JSONB and, relatedly, UTF code
> > point 0 in TEXT?
>
> No. It's basically never going to happen because of the widespread use
> of C strings (nul-terminated strings) inside the backend. Making \0 a
> legal member of strings would break all those internal APIs, requiring
> touching far more code than anyone would want to do. It'd likely break
> a great deal of client-side code as well.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-07-19 22:32:53 Re: Support for \u0000?
Previous Message Tom Lane 2017-07-19 22:14:36 Re: UPDATE column without FK fires other FK triggers constraint check