Re: how to pass in bind variables with cursor.copy_expert? - Mailing list psycopg

From Adrian Klaver
Subject Re: how to pass in bind variables with cursor.copy_expert?
Date
Msg-id 5307A26C.2050807@aklaver.com
Whole thread Raw
In response to how to pass in bind variables with cursor.copy_expert?  ("W. Matthew Wilson" <matt@tplus1.com>)
List psycopg
On 02/21/2014 08:27 AM, W. Matthew Wilson wrote:
> 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?

Now I see what I was missing. I did not read the subject fully and see
you wanted to use copy_expert. In that situation, I do as Federico
suggested and build the full query first then pass it to copy_expert.

>
> Thanks in advance.
>
> Matt
>



psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: how to pass in bind variables with cursor.copy_expert?
Next
From: Ari King
Date:
Subject: Fwd: Timestamp Query Parameters