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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-jdbc by date

  From Date Subject
Next Message Peirong Feng (pefeng) 2009-06-04 20:28:59 how to modify connection socket timeout
Previous Message Hannu Krosing 2009-06-04 12:21:04 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\":