Passing Parameters to copy_expert()? - Mailing list psycopg

From Victor Hooi
Subject Passing Parameters to copy_expert()?
Date
Msg-id CAMnnoU+BdJqgrhJQXFRmTPMbn3tk2WeGQmL60HdcB6zjOrOp4Q@mail.gmail.com
Whole thread Raw
Responses Re: Passing Parameters to copy_expert()?
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Best strategy for bulk inserts where some violate unique constraint?
Next
From: Daniele Varrazzo
Date:
Subject: Re: Passing Parameters to copy_expert()?