This project is archived and is in readonly mode.
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=192.168.0.33 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()
source.write("foo\tbar")
source.seek(0)
# 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
-
Daniele Varrazzo September 22nd, 2011 @ 09:10 AM
- State changed from new to invalid
What psycopg version are you using?
The current head works fine: the problem has been most likely fixed in Psycopg 2.3 one year ago.
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="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
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.