Re: Rollback after "Connection timed out"?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Rollback after "Connection timed out"?
Date: 2023-10-27 14:45:02
Message-ID: 1552283.1698417902@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Ron <ronljohnsonjr(at)gmail(dot)com> writes:
> On Server_A, I ran:
> psql --host=blarge mydb -c "ALTER TABLE blah ..."

> After about 2 hours, it displayed this message:
> Could not receive data from server: Connection timed out
> Connection to server was lost

> And yet the ALTER TABLE (it's heavily inheritance-partitioned) is still
> running on blarge.  Is it still working, or is it rolling back (which I'd
> expect to be fast)?

It will probably run to completion if you leave it alone. The
server would only notice loss of connection when it next tries to
send something to the client, which (barring error/notice
messages) would be the command completion report.

For next time, you might want to think about reducing the
TCP keepalive interval settings.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Laurenz Albe 2023-10-27 15:54:36 Re: ORDER BY DESC and NULLS LAST by default
Previous Message Arjan Saly Consultancy (EU) 2023-10-27 14:42:48 Re: ORDER BY DESC and NULLS LAST by default