Skip to content
Pivot is in early development and is not production ready. See Project status.

COPY

COPY ... FROM STDIN ingests an Arrow IPC stream over the PostgreSQL wire protocol.

For an existing events table with id and region columns, a client starts its copy session with:

COPY events (id, region) FROM STDIN WITH (FORMAT arrow);

The client then sends Arrow IPC bytes through the wire protocol’s copy interface and finishes the stream. The SQL statement opens the copy session; the row data is sent separately.

COPY table_name [(column [, ...])]
FROM STDIN WITH (FORMAT arrow);

An explicit column list chooses the target columns. Columns omitted from the list are filled with NULL.

FORMAT arrow is required for the supported form. Arrow IPC is the only supported copy format.

In pivot open, \copy runs the same COPY with rows read from a local file:

\copy events (id, region) FROM 'events.arrow' WITH (FORMAT arrow)

CSV and plain-text copy input are not supported. This form receives data from a client; it does not read a named server-side file.