I am currently a user of a Postgres database (I am not the DBA). Within my sandbox I run several business critical scripts every day and currently track their status by first in a log text file on my desktop while running the scripts in a batch file. I am trying to create a table in my sandbox that can be used for reporting and analysis that includes the status of the scripts as well as if any of them have failed to run properly or not. Such as:
----------------------------------------+-----------
Beginning Script-A | Timestamp
Script-A Completed Successfully | Timestamp
Beginning Script-B | Timestamp
Script-B failed to Run Successfully | Timestamp
----------------------------------------+-----------
How could I do this?
now()
, then do insert statements likeINSERT INTO my_table(log_column) VALUES('Starting Script A')
for logging. – Jason Scheirer 2 days agoclock_timestamp()
becausenow()
is the start time of the transaction. – Jay Cummins yesterday