my postgres version is 12.4 , I'm loading multiple csv files into single table, The problem here is every time firing below command is not good ,any other alternative (or) suggestions are there?
COPY testemail FROM '/md-data/vamshi/s3data/test_Hash_2021.csv' WITH (FORMAT csv);
COPY testmail FROM '/md-data/vamshi/s3data/test_Hash_2025.csv' WITH (FORMAT csv);
COPY testmail FROM '/md-data/vamshi/s3data/test_Hash_2026.csv' WITH (FORMAT csv);
..............etc
and below command also i tried, but its not working,
COPY testemail FROM '/md-data/vamshi/s3data/t*.csv' WITH (FORMAT csv);
copydoesn't support wildcards. If you want to automate this, write a shell script that iterates over the files and runs COPY for each of them. Or write a shell script that copies all files into one large file, then run the COPY once