doc: clarify COPY TO for partitioning/inheritance
authorBruce Momjian
Wed, 16 Dec 2020 00:20:15 +0000 (19:20 -0500)
committerBruce Momjian
Wed, 16 Dec 2020 00:20:15 +0000 (19:20 -0500)
It was not clear how COPY TO behaved with partitioning/inheritance
because the paragraphs were so far apart.  Also reword to simplify.

Discussion: https://postgr.es/m/20201203211723[email protected]

Author: Justin Pryzby

Backpatch-through: 10

doc/src/sgml/ref/copy.sgml

index 0d865b480315f94f3f0b6b9ea4d18a038cc3409b..4c1e7dfef32567eaf9efc5eb78d717484f303bb8 100644 (file)
@@ -411,10 +411,16 @@ COPY count
   Notes
 
    
-    COPY TO can only be used with plain tables, not
-    with views.  However, you can write COPY (SELECT * FROM
-    viewname) TO ...
-    to copy the current contents of a view.
+    COPY TO can be used only with plain
+    tables, not views, and does not copy rows from child tables
+    or child partitions.  For example, COPY 
+    class="parameter">table TO copies
+    the same rows as SELECT * FROM ONLY 
+    class="parameter">table.
+    The syntax COPY (SELECT * FROM 
+    class="parameter">table) TO ... can be used to
+    dump all of the rows in an inheritance hierarchy, partitioned table,
+    or view.
    
 
    
@@ -423,16 +429,6 @@ COPY count
     INSTEAD OF INSERT triggers.
    
 
-   
-    COPY only deals with the specific table named;
-    it does not copy data to or from child tables.  Thus for example
-    COPY table TO
-    shows the same data as SELECT * FROM ONLY 
-    class="parameter">table.  But COPY
-    (SELECT * FROM table) TO ...
-    can be used to dump all of the data in an inheritance hierarchy.
-   
-
    
     You must have select privilege on the table
     whose values are read by COPY TO, and