Hi. I have the following exception when using sqlalchemy on postgres:
raise exc.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
ProgrammingError: (ProgrammingError) can't adapt 'UPDATE doc_data SET content=%(content)s WHERE doc_data.serial_id = %(doc_data_serial_id)s' {'content': 'Programas de publicidad - Soluciones Empresariales - Todo acerca de Google - Google.com in English \xc2\xa92010 - Privacidad', 'doc_data_serial_id': 3181L, 'title': 'Google'}
The text is the one that appears in www.google.com.ar (at the bottom)... "Programas de publicidad - Soluciones Empresariales - Todo acerca de Google - Google.com in English ©2010 - Privacidad". The content is unicode....
The model is:
class DocData(Data):
__tablename__ = 'doc_data'
serial_id = Column(Integer, ForeignKey('data.serial_id', ondelete='cascade'),
primary_key=True)
content = Column(UnicodeText)
And the database is:
CREATE TABLE doc_data
(
serial_id integer NOT NULL,
"content" text
)
WITH (OIDS=FALSE);
Any ideas of why the error take place? When doing the same query on postgres I get a warning: "HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.". BUt I don't understand why that happens because I am using the model to make the query, so SQLALchemy (i think) should escape the carahcters.
Thanks in advance