HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Will my query continue to execute after I shut off my computer

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
aftershutcontinuequerywillcomputeroffexecute

Problem

I am running a very expensive query that I executed via pgAdmin 4 which is installed on my laptop. I am executing the query on a cloud server.

The message that I see is 'Waiting for query execution to complete...'

If I shut my laptop off right now, will the query continue to run until completed?

Thanks.

Solution

Probably not.

The server will detect that the TCP connection has been closed sooner or later and then try to cancel the query.

You may have success with suspend instead of shutdown, but it's not guaranteed to work.

Your best option is to connect to the server (or to some other always-on server) and run the query there using the psql command-line in a tmux, or screen session etc.

PgAgent may also be worth considering.

Context

StackExchange Database Administrators Q#213482, answer score: 2

Revisions (0)

No revisions yet.