I'm running queries on a Redshift cluster using DataGrip that take upwards of 10 hours to run and unfortunately these often fail. Alas, DataGrip doesn't maintain a connection to the database long enough for me to get to see the error message with which the queries fail.
Is there a way of retrieving these error messages later, e.g. using internal Redshift tables? Alternatively, is there are a way to make DataGrip maintain the connection for long enough?
Yes, you Can!
Query
stl_connection_logtable to find outpidby looking at therecordtimecolumn when your connection was initiated and alsodbname,usernameanddurationcolumn helps to narrow down.If you can find the
pid, you can querystl_querytable to find out if are looking at right query.Then, check the
stl_errortable for yourpid. This will tell you the error you are looking for.If I’ve made a bad assumption please comment and I’ll refocus my answer.