PostgreSQL 18 · Backup and restore
Export a table to CSV
Write a table to a CSV file on your machine, from inside psql.
\copy users TO 'users.csv' WITH (FORMAT csv, HEADER)
Official PostgreSQL 18 documentation
PostgreSQL 18 · Backup and restore
Write a table to a CSV file on your machine, from inside psql.
\copy users TO 'users.csv' WITH (FORMAT csv, HEADER)
Official PostgreSQL 18 documentation
Was this page helpful?