PostgreSQL

Updated: 28 February 2026

Create a temporary table from a select statement

CREATE TEMP TABLE narrow_table AS SELECT foo, bar from broad_table;

Dump a table to csv format file

COPY book TO '/tmp/book_entries.csv' WITH (FORMAT CSV, HEADER);

Leave a comment