Postgresql 8.3.x requires 'E' prefix before string literals with backslashed escapes (i.e. field = E'\n\r\t' instead of field='\n\r\t')
Without it LOTs of db warnings are produced by caching module.
Attached patch adds this prefix in db_encode_blob() function.
NOTE: this is only an idea. For general use, this code needs to be reworked with PgSQL version checks.