getquoted and unicode

From: "Carl S(dot) Yestrau Jr(dot)" <carl(at)featureblend(dot)com>
To: psycopg(at)postgresql(dot)org
Subject: getquoted and unicode
Date: 2011-01-23 07:53:23
Message-ID: AANLkTik+tq8hbnCj3ROmOLNV1DSw48o4sDoSvnxTN3R8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

I'm currently using psycopg2.extensions.adapt without a connection
intentionally.

The following results in a: psycopg2.InterfaceError: can't encode
unicode string to latin-1

import psycopg2

psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
adapted = psycopg2.extensions.adapt(u'test')
adapted.getquoted()

Any tips greatly appreciated!

Responses

Browse psycopg by date

  From Date Subject
Next Message Karsten Hilbert 2011-01-23 11:42:42 Re: getquoted and unicode
Previous Message Adrian Klaver 2011-01-20 15:58:19 Re: How to use the postgresql money type?