I have a PostgreSQL database running in a docker container. I used the below command to get a dump file of the Postgres database - "docker exec -t your-db-container pg_dumpall -c -U postgres > dump_date +%d-%m-%Y"_"%H_%M_%S
.sql". Since it's a docker volume , the database doesn't store on the machine to use psql COPY command and such.
I have multiple tables with different headers. I need to convert the dump file into a CSV file with the headers of the table. Can be a single or multiple CSV files.
Any other way of directly getting the CSV files from the docker container database will also be appreciated.
PS: I'm a beginner in this area and would really appreciate a detailed solution
COPY
command to export data as CSV.