This project is archived and is in readonly mode.

#70 ✓invalid
Chris Curvey

support unicode strings in column list for copy_from()

Reported by Chris Curvey | September 16th, 2011 @ 03:12 PM

It would be a nice feature if the copy_from() method supported unicode strings. For example:

import psycopg2

conn = psycopg2.connect("host= user=chris password=postgres dbname=certified_mail_ccc")
cursor = conn.cursor()

cursor.execute("drop table if exists foo")
cursor.execute("create table foo (a varchar(100), b varchar(100))")

import StringIO
source = StringIO.StringIO()

# this does not work
#cursor.copy_from(source, "foo", null="None", columns=[u"a", u"b"])

# this does work
#cursor.copy_from(source, "foo", null="None", columns=["a", "b"])

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="">the new tracker</a>.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins