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?
Postgresql – get results from a Postgres query that I got disconnected from
postgresqlpsql
Related Question
- Postgresql – connecting to Postgres running inside docker container ‘posgres’ does not exist
- PostgreSQL – How to Run psql in Windows Command Prompt
- PostgreSQL – How to Resolve Stuck Select/Update Query in Node.js
- PostgreSQL – View Operation Timestamps for Long Running Operations in PSQL
- psql: /usr/pgsql-11/lib/libpq.so.5: No Version Information Available – Meaning and Fix
Best Answer
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.