how to pass in bind variables with cursor.copy_expert?

From: "W(dot) Matthew Wilson" <matt(at)tplus1(dot)com>
To: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: how to pass in bind variables with cursor.copy_expert?
Date: 2014-02-21 16:27:51
Message-ID: CAGHfCUAW+MLKFJuTz7t=m+b7oNAArEvo7ip1tkeAgyrXpqC7Tg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: psycopg

I need to extract some rows from a table as a CSV file, based on a
query sort of like:

copy (
select *
from blah
where x = %(x)s
)

but I don't see how to pass in a dictionary with values for the query!

Is this not allowed?

What am I missing?

Thanks in advance.

Matt

--
W. Matthew Wilson
matt(at)tplus1(dot)com
http://tplus1.com

Responses

Browse psycopg by date

  From Date Subject
Next Message Federico Di Gregorio 2014-02-21 16:47:02 Re: how to pass in bind variables with cursor.copy_expert?
Previous Message Karsten Hilbert 2014-02-05 13:11:56 Re: Differentiating various OperationalError 'states'