pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Ken Johanson <pg-user@kensystem.com>
Cc: James Im <im-james@hotmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
Date: Thu, 22 Feb 2007 21:54:01 +1300
Message-ID: <45DD5A29.8020400@opencloud.com> (raw)
In-Reply-To: <45DD3A3F.5050609@kensystem.com>
References: <BAY7-F17FFE0E324AB3B642C547E96890@phx.gbl>
	<45DAE076.1060407@opencloud.com>
	<45DD3A3F.5050609@kensystem.com>

Ken Johanson wrote:

> At least on other servers/drivers I believe nulls are supported (and 
> should be according to some spec) (The only special-meaning char is 
> single quote).

The driver can't do anything about it, it's a server issue. I can think 
of some ways the server could support it without extensive changes .. 
e.g. use a "modified UTF8" representation which stores \u0000 as 0xc0 
0x80 internally .. but you'd have to take that up with the backend 
developers.

> I'm wondering how the binary protocol works insofar as handling the NULL 
> byte; does it precede it with a backslash?

The driver sends string parameters out-of-line without escaping (i.e. 
length field, then raw utf-8 data). The error you see is generated when 
the server notices that there's a \u0000 there; it rejects the string 
entirely rather than silently mangling it.

-O



view thread (29+ messages)  latest in thread

Message-ID: <45DD5A29.8020400@opencloud.com>
Permalink:  ../45DD5A29.8020400@opencloud.com/
Also on:    postgresql.org/message-id/45DD5A29.8020400@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: oliver@opencloud.com, pg-user@kensystem.com, im-james@hotmail.com, pgsql-jdbc@postgresql.org
  Subject: Re: invalid byte sequence for encoding "UTF8": 0x00
  In-Reply-To: <45DD5A29.8020400@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox