From 1370e059b4262149667af81932907944d3730f6e Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 2 Dec 2020 19:03:15 +0000 Subject: [PATCH] Fixed COPY statement suggesting it accepts parameters It was, it just didn't work... :P --- docs/from_pg2.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/from_pg2.rst b/docs/from_pg2.rst index a954e17d6..ca3d87506 100644 --- a/docs/from_pg2.rst +++ b/docs/from_pg2.rst @@ -82,12 +82,12 @@ type you should check the :ref:`adaptation` topic. Copy is no more file-based -------------------------- -`psycopg2` exposes :ref:`a few copy methods ` to interact with +`!psycopg2` exposes :ref:`a few copy methods ` to interact with PostgreSQL :sql:`COPY`. The interface doesn't make easy to load dynamically-generated data to the database. There is now a single `~psycopg3.Cursor.copy()` method, which is similar to -`~cursor.copy_expert()`, which accepts parameters like `!execute()` and +`!psycopg2` `!copy_expert()` in accepting a free-form :sql:`COPY` command and returns an object to read/write data, block-wise or record-wise. The different usage pattern also enables :sql:`COPY` to be used in async interactions. @@ -100,7 +100,7 @@ See :ref:`copy` for the details. ------------------- When the connection is used as context manager, at the end of the context -the connection will be closed. In psycopg2 only the transaction is closed, +the connection will be closed. In `!psycopg2` only the transaction is closed, so a connection can be used in several contexts, but the behaviour is surprising for people used to several other Python classes wrapping resources, such as files. -- 2.47.2