Passing Parameters to copy_expert()?
| От | Victor Hooi |
|---|---|
| Тема | Passing Parameters to copy_expert()? |
| Дата | |
| Msg-id | CAMnnoU+BdJqgrhJQXFRmTPMbn3tk2WeGQmL60HdcB6zjOrOp4Q@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Passing Parameters to copy_expert()?
|
| Список | psycopg |
Hi,
I'm trying to use the copy_expert() command to dump records from a database to CSV.
However, I need to pass some parameters into the SQL statement - namely the values for a WHERE IN clause.
(Basically, the COPY operation is too big for our PostgreSQL server to handle, so we're chunking it up into multiple queries - hence, needing to pass in values to WHERE IN).
I can't seem to see anything in the docs about this about how to pass parameters through to copy.
I could use Python's own string interpolation, however, I'm under the impression that's a pretty bad thing.
Is there another way to pass parameters to copy_expert()?
Cheers,
Victor
В списке psycopg по дате отправления: