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 ~

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c0ff43-151f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c0ff43-151f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?