I currently have a bash script that runs a bunch of psql scripts. These psql scripts look like:
psql -a -f "filename.sql"
psql -a -f "filename2.sql"
etc.
So each psql is executing PostgreSQL stored in different files. I am running a series of them in a bash script, and it would be helpful for me to know how long each file is taking.
A hacky way I thought of doing this is to just print date before and after each one (i.e.)
date
psql -a -f "filename.sql"
date
psql -a -f "filename2.sql"
date
Is there a smarter way to do this?