Can not close psql

Started by PG Bug reporting form6 months ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/app-psql.html
Description:

Hello.
I was connected to database via `psql` then I rebooted DB. I was not able to
disconnect from terminal after that. Only whole window close helped.

```
userdb=>
userdb=> \d
FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset:
^C^C^C^C

^C^C^C^C^C

^C^C^C^C^C
^X^Z
3
asdf

dfafasf

^C^C^C^C^C^C^C
```

It would be nice if `psql` allows to disconnect from console if a connection
to database was lost.

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Can not close psql

On Thursday, October 16, 2025, PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/app-psql.html
Description:

Hello.
I was connected to database via `psql` then I rebooted DB. I was not able
to
disconnect from terminal after that. Only whole window close helped.

It would be nice if `psql` allows to disconnect from console if a
connection
to database was lost.

Seems like this would be better reported as an actual bug. Not as comments
related to the effectiveness of the documentation.

David J.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Can not close psql

PG Doc comments form <noreply@postgresql.org> writes:

I was connected to database via `psql` then I rebooted DB. I was not able to
disconnect from terminal after that. Only whole window close helped.

A documentation comment is a very poor way to submit a trouble
report...

FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset:
^C^C^C^C

Hmm. When I try this I get either

postgres=# \d
FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset: Failed.
!?>

or

postgres=# \d
FATAL: terminating connection due to administrator command
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset: Succeeded.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
postgres=#

(depending on whether I restarted the server yet), with pretty
much no delay. You'll need to provide a lot more context about
your setup if you want useful help. What's the platform? Is
the server on the same machine as psql, or remote? What
connection options are you using besides SSL? What OpenSSL
version is psql using? For that matter, which psql version
is it?

https://wiki.postgresql.org/wiki/Guide_to_reporting_problems

regards, tom lane