Re: how to pass in bind variables with cursor.copy_expert?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: how to pass in bind variables with cursor.copy_expert?
Дата
Msg-id 5307A26C.2050807@aklaver.com
обсуждение исходный текст
Ответ на how to pass in bind variables with cursor.copy_expert?  ("W. Matthew Wilson" <matt@tplus1.com>)
Список 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 по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: how to pass in bind variables with cursor.copy_expert?
Следующее
От: Ari King
Дата:
Сообщение: Fwd: Timestamp Query Parameters