You can use this alternative:
\copy (SELECT col1, col2, col3... from cities) TO '/var/lib/pgsql/cities.csv' (DELIMITER ',', FORMAT 'csv', HEADER)
The list col1, col2, col3... should only contain names on necessary columns and not under any circumstances the geometry column
--
Med venlig hilsen / Kind regards
Bo Victor Thomsen
Den 04-03-2020 kl. 19:38 skrev postggen2020 s:
\copy cities TO '/var/lib/pgsql/cities.csv' (DELIMITER ',', FORMAT 'csv', HEADER)