Skip site navigation (1) Skip section navigation (2)

Re: Making TEXT NUL-transparent

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Alexander Shulgin <ash(at)commandprompt(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Making TEXT NUL-transparent
Date: 2011-11-24 09:54:09
Message-ID: 82r50xrgla.fsf@mid.bfk.de (view raw or flat)
Thread:
Lists: pgsql-hackers
* Alexander Shulgin:

>> It's actually UTF-8 text, and some PostgreSQL functions are only
>> available for TEXT, but not BYTEA, e.g.:
>> 
>> bfk_int=> SELECT '\x006500'::bytea ~ 'A';
>> ERROR:  operator does not exist: bytea ~ unknown
>
> And how will those TEXT functions behave on a value with an embedded
> NUL?

They need to be audited and fixed if necessary.  I'm not saying that
this would be a trivial change.

> Or is it not only about being able to *store* NULs in a text field?

No, the entire core should be NUL-transparent.

By the way, I refuse the notion that UTF-8 strings with embedded NULs
are "broken".  I can't recall any other system which enforces UTF-8
well-formedness, but does not permit embedded NULs.

-- 
Florian Weimer                <fweimer(at)bfk(dot)de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstra├če 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

In response to

Responses

pgsql-hackers by date

Next:From: Pavel StehuleDate: 2011-11-24 10:20:01
Subject: Re: Making TEXT NUL-transparent
Previous:From: Pavel StehuleDate: 2011-11-24 09:41:08
Subject: Re: Making TEXT NUL-transparent

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group