COPY TO sends rows using the Postgres COPY protocol.
|field||The name of the option you want to set.|
|val||The value for the option.|
|Name||Value type||Default value||Description|
||Sets the output formatting method.|
Copying a view
COPY (SELECT * FROM some_view) TO STDOUT;
Subscribing to a view with binary output
COPY (SUBSCRIBE some_view) TO STDOUT WITH (FORMAT binary);
The privileges required to execute this statement are:
USAGEprivileges on the schemas that all relations and types in the query are contained in.
SELECTprivileges on all relations in the query.
- NOTE: if any item is a view, then the view owner must also have the necessary privileges to execute the view definition. Even if the view owner is a superuser, they still must explicitly be granted the necessary privileges.
USAGEprivileges on all types used in the query.
USAGEprivileges on the active cluster.