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

Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: john(dot)lister(at)kickstone(dot)com
Cc: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>, pgsql-jdbc-owner(at)postgresql(dot)org, Kris Jurka <books(at)ejurka(dot)com>, user2037(at)ymail(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":
Date: 2009-06-04 13:22:56
Message-ID: 4A27CAB0.4040605@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
John Lister wrote:
> Apologies for top post using a blackberry. The binary mode should be able to cope fine as it passes the length before sending the data. Should be straightforward to add strings to patch.

It's not that we can't transfer strings with embedded zero bytes to the
server (we can), it's that the server does not handle the resulting
string. From memory it just truncates the string at that point. So we
disallow it in the driver rather than causing strange effects on the
server side.

So adding support for these strings to the binary patch would actually
be a regression.

-O

In response to

pgsql-jdbc by date

Next:From: Peirong Feng (pefeng)Date: 2009-06-04 20:28:59
Subject: how to modify connection socket timeout
Previous:From: Hannu KrosingDate: 2009-06-04 12:21:04
Subject: Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":

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