I have a Postgres purging script in bash where I used to run multiple commands on different tables i.e.
-
copy data to temp table. i.e.
table1 -> temp_table1 -
delete data from original table
based on the temp tables.
for both the above steps, for each table I am connecting to the database. Is there a way to connect to database at once and execute the above steps on different tables using Perl.
See the DBI docs for more details.