1

I started an hours-long Postgres query in my psql shell. Then, I got disconnected from the network and had to make a new psql shell. If I look in pg_stat_activity, I see that my query is still running. Can I connect to that query and get its output?

2 Answers 2

0

Unfortunately you can't. However, if the query is for changing data and there isn't any transaction started, then it will make the change. Next time start a screen or save results to a file.

0

No. If the process is long use intermediate tables + screen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.