So I have an ORM session that I've called session.begin() on to start a 
transaction.

I found from some other posts that I can get access to postgres COPY 
command via psycopg2's copy_from method.

So a simple test case for my code looks something like this:

session.begin()
session.execute("CREATE SCHEMA data");
cursor = session.bind.raw_connection().cursor()
cursor.copy_from(open("data.raw", "data.table1"))

The problem I'm having is that the CREATE SCHEMA command was created in the 
transaction, and the cursor that 
I'm trying to use copy_from does not contain state from that transaction.

What I'm wondering is if there's a way I can get access to the raw cursor 
that has my pending transaction, so I can call copy_from on it and continue 
to use sqlalchemy for other things.

Regards,
J

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to