Jeff Davis pgsql
Wed Nov 1 10:52:44 PST 2006
Versions:
Slony 1.2.1 RC1
PostgreSQL 8.1.4, encoding UTF-8

If you are replicating a table with a text field that contains invalid
byte sequences, Slony-I is unable to replicate the data.

For instance, you can do:

INSERT INTO foo(mytextattr) VALUES('\xff');

Which puts an invalid byte sequences into the text field.

Then Slony tries to replicate it, but PostgreSQL throws an "invalid byte
sequence" error. Replication is halted until someone removes the
offending value. The basic problem is that if you have an invalid byte
sequence in a field, you can COPY out, but can't COPY back in (or insert
back in, or any other way aside from re-escaping the value).

Any thoughts? Is this a bug somewhere, or is it the fault of the
application for sending a query that contains escape sequences? I asked
on the PostgreSQL lists, but nobody there seems to think it's a bug. It
is documented PostgreSQL behavior.

Slony might be able to guard against the behavior by using the send/recv
functions rather than the out/in functions for the types. However, that
would only work for INSERTs, because I don't think you can make COPY use
those.

Regards,
	Jeff Davis




More information about the Slony1-general mailing list