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?

asked Sep 12, 2016 at 16:54

2 Answers 2

1

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.

answered Sep 12, 2016 at 17:19
1

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

answered Sep 12, 2016 at 17:41

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.