I have access to DB on remote server where I can do only select command, So, I can execute:
COPY products TO '/tmp/products.csv' DELIMITER ',';
But on that server I don't have permission to create/save file, so I need to do this on my local machine.
So, the questions are:
When I connected to remote DB, how to execute PG command to save file on my local machine instead to remote server?
Or, how to execute Linux command to connect to remote DB, execute query and save file on my local machine?