I'm trying to bulk-load into a postgres database using the COPY facility.  
The problem I'm facing is that sqlalchemy is including quotes for the table 
name during binding and postgres raises an exception due to the quotes:

    conn.execute(text("""COPY :tbl_name from :csv_path (format 
:file_format, delimiter :delim, quote :quote)"""),
                        tbl_name=tbl_name,
                        file_format=file_format,
                        csv_path=csv_path,
                        delim=delim,
                        quote=quote)


Postgres raises with an exception on tbl_name.   If, for instance, tbl_name 
= 'my_table'   , sqlalchemy is binding it to:  "COPY 'my_table'  ....' when 
instead it must be  "COPY my_table ...."

What's the recipe to handle this literal value?

Thanks :)


-Darin

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to