Materialize Logo

COPY TO

COPY TO sends rows using the Postgres COPY protocol.

Syntax

COPY ( query ) TO STDOUT WITH ( option , )
Field Use
query The SELECT or TAIL query to send

Supported option values:

Name Value
FORMAT text for text output (the default)
FORMAT binary for binary output

Example

Copying a view

COPY (SELECT * FROM some_view) TO STDOUT

Tailing a view with binary output

COPY (TAIL some_view) TO STDOUT WITH (FORMAT binary)