Re: Suggestion to reduce COPY command output to csv file - Mailing list pgsql-admin

From Bo Victor Thomsen
Subject Re: Suggestion to reduce COPY command output to csv file
Date
Msg-id 334c89b7-8643-2642-4fe9-8f8ca4905526@gmail.com
Whole thread Raw
In response to Suggestion to reduce COPY command output to csv file  (postggen2020 s <postggen2020@gmail.com>)
List pgsql-admin

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)

		
	

pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Suggestion to reduce COPY command output to csv file
Next
From: Scott Ribe
Date:
Subject: shm