How to convert tables to CSV? in ubuntu virtual machine by postgres

how does postgres convert tables to CSV? in ubuntu virtual machines

google found
COPY (
SELECT name, category_name
FROM products
LEFT JOIN categories ON categories.id = products.category_id
)
TO"/ path/to/output.csv"
WITH csv;

but using this will prompt ERROR: relative path not allowed for COPY to file

ask for the correct export posture

Mar.13,2021

use the copy statement to help you batch export the specified query results to a csv file or some other format file. It's just that you have a slight problem with your usage:

according to

try again ~

Menu