I'm using psql to run a .sql file to copy data from csv files into Postgres, but the folder contains csv files is changed everyday, so I want to add a variable into path code
This is my code
delete from table1;
delete from table2;
delete from table3;
\copy table1 FROM 'D:\tamlam\' + convert(date,getdate()) + '\file1.csv' DELIMITER ',' CSV HEADER QUOTE '"' NULL '';