I'm trying to download the select output query as a csv file into my local machine, from the server where the database is stored. I tried using the \copy command :
\copy (SELECT COUNT(*) FROM table) to 'C:\Folder\temp.csv' With CSV DELIMITER ',' HEADER;
It gives output COPY 1 in the terminal, but doesn't generate any csv file in the location. Would really appreciate any help, thanks !