This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 5151e878c docs: add USE_COPY recipe and update PostgreSQL docs (#2859)
5151e878c is described below
commit 5151e878c94ffe15498ce1c189ff74845e57d631
Author: David Li <[email protected]>
AuthorDate: Mon May 26 11:11:00 2025 +0900
docs: add USE_COPY recipe and update PostgreSQL docs (#2859)
For this discussion:
https://github.com/apache/arrow-adbc/discussions/2857
---
docs/source/driver/postgresql.rst | 23 +++++++++++-----------
docs/source/python/recipe/postgresql.rst | 7 +++++++
.../python/recipe/postgresql_execute_nocopy.py | 8 ++++----
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/docs/source/driver/postgresql.rst
b/docs/source/driver/postgresql.rst
index 8c54ee7b0..8bcfd2db4 100644
--- a/docs/source/driver/postgresql.rst
+++ b/docs/source/driver/postgresql.rst
@@ -168,18 +168,17 @@ the :c:struct:`AdbcDatabase`. This should be a
`connection URI
Supported Features
==================
-The PostgreSQL driver mostly supports features defined in the ADBC API
-specification 1.0.0, but not all cases are fully implemented
-(particularly around bind parameters and prepared statements).
-
-Bind Parameters and Prepared Statements
----------------------------------------
-
-The PostgreSQL driver only supports executing prepared statements with
-parameters that do not return result sets (basically, an INSERT with
-parameters). Queries that return result sets are difficult with prepared
-statements because the driver is built around using COPY for best
-performance, which is not supported in this context.
+The PostgreSQL driver supports features defined in the ADBC API specification
+1.0.0.
+
+COPY query execution
+--------------------
+
+The PostgreSQL driver executes queries with ``COPY`` for best performance.
+PostgreSQL does not support this for all queries, however (such as ``SHOW``).
+The optimization can be disabled by the statement option
+``adbc.postgresql.use_copy``. For an example, see
+:ref:`recipe-postgresql-statement-nocopy`.
Bulk Ingestion
--------------
diff --git a/docs/source/python/recipe/postgresql.rst
b/docs/source/python/recipe/postgresql.rst
index 0b5094064..f1f885d02 100644
--- a/docs/source/python/recipe/postgresql.rst
+++ b/docs/source/python/recipe/postgresql.rst
@@ -46,6 +46,13 @@ Execute a statement with bind parameters
.. recipe:: postgresql_execute_bind.py
+.. _recipe-postgresql-statement-nocopy:
+
+Execute a statement without COPY
+================================
+
+.. recipe:: postgresql_execute_nocopy.py
+
Get the Arrow schema of a table
===============================
diff --git a/docs/source/python/recipe/postgresql_execute_nocopy.py
b/docs/source/python/recipe/postgresql_execute_nocopy.py
index b9f63bcda..8a250b88b 100644
--- a/docs/source/python/recipe/postgresql_execute_nocopy.py
+++ b/docs/source/python/recipe/postgresql_execute_nocopy.py
@@ -19,10 +19,10 @@
# RECIPE KEYWORDS: statement options
# RECIPE STARTS HERE
-#: PostgreSQL does not support ``COPY`` for all kinds of queries, for example,
-#: queries that use ``SHOW``. But the ADBC driver tries to execute queries
-#: with COPY by default since it is faster for large result sets. In this
-#: case, you can explicitly disable the ``COPY`` optimization.
+#: The ADBC driver tries to execute queries with COPY by default since it is
+#: faster for large result sets. PostgreSQL does not support ``COPY`` for all
+#: kinds of queries, however. For example, ``SHOW`` queries will not work.
+#: In this case, you can explicitly disable the ``COPY`` optimization.
import os