[plt-dev] pgsql package

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Tue Jul 28 03:45:38 EDT 2009

Robby Findler wrote:
> Hi all (Ryan?): I've got a question about pgsql. From what I can tell,
> string data is stored in the database in the latin-1 encoding
> (sql-data.ss line 191), but is then retrieved from the database in the
> utf-8 encoding (io.ss line 205). Am I getting that right?
> 
> This doesn't mean much, but I changed planet's copy of io.ss to use
> bytes->string/latin-1 instead of bytes->string/utf-8, and I was able
> to avoid crashing (but the latin-1 encoding might not have any
> unencodable octets, so that isn't really saying too too much).

I don't know of any reason for latin-1 to show up in string code... 
maybe for "bytea" code. It might be a mistake from the port to 200, when 
string and bytes split. So the change sounds good.

Were you able to get a crash before? Or data corruption? If you send me 
some code to produce it, I'll add it to the test suite. Since the line 
numbers you list don't correspond to recent spgsql releases, it's 
possible this bug has already been fixed and planet is just using an old 
version.

Ryan



Posted on the dev mailing list.