summaryrefslogtreecommitdiff
path: root/doc/src/cursor.rst
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-03-16 00:12:13 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-03-16 00:55:20 +0000
commitc7f569042642c7cbed7b9a935092a218c046d296 (patch)
treee490cb13b36df30750c592c04b0bd2c647c96997 /doc/src/cursor.rst
parent3bfbd3a0a546b2b5bf30476dfa838cd05ddab442 (diff)
downloadpsycopg2-sql-copy.tar.gz
Added docs about the usability of sql objects with copy_expert()sql-copy
See issue #529.
Diffstat (limited to 'doc/src/cursor.rst')
-rw-r--r--doc/src/cursor.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/src/cursor.rst b/doc/src/cursor.rst
index c03cea8..417ab6c 100644
--- a/doc/src/cursor.rst
+++ b/doc/src/cursor.rst
@@ -601,7 +601,10 @@ The ``cursor`` class
The *sql* statement should be in the form :samp:`COPY {table} TO
STDOUT` to export :samp:`{table}` to the *file* object passed as
argument or :samp:`COPY {table} FROM STDIN` to import the content of
- the *file* object into :samp:`{table}`.
+ the *file* object into :samp:`{table}`. If you need to compose a
+ :sql:`COPY` statement dynamically (because table, fields, or query
+ parameters are in Python variables) you may use the objects provided
+ by the `psycopg2.sql` module.
*file* must be a readable file-like object (as required by
`~cursor.copy_from()`) for *sql* statement :sql:`COPY ... FROM STDIN`