There are three different databases hosted on three different servers. There is a table and a procedure created for this table as well. It truncates it's dta and refreshes the table and then fill in new data in there from two different tables. Now the point is I wanted to send the output of the query, select * from table; via mail and also schedule the procedure to be called on its own each day. I did this using pgAdmin, created a bash script, procedure is called and output of the table is sent via mail. This is sorted.
Now I want the same thing to happen on all three servers, but instead of three different mails, I want to send one single mail containing output of query from all three tables in those three different databases hosted on three different servers. How can I achieve that using pgagent?