My workflow is to have a terminal tab open with a postgres shell (via tdb shell) open at all times. However when you run a tdb command that drops a database it fails if there is an existing session.
This PR triggers a postgres statement which will kill any existing sessions allowing the database drop to proceed.
In the session that's been dropped, if you execute another command after the session was killed you get an error:
FATAL: terminating connection due to administrator command
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
but then it auto-reconnects and you can just repeat the command from history.
My workflow is to have a terminal tab open with a postgres shell (via tdb shell) open at all times. However when you run a tdb command that drops a database it fails if there is an existing session.
This PR triggers a postgres statement which will kill any existing sessions allowing the database drop to proceed.
In the session that's been dropped, if you execute another command after the session was killed you get an error:
but then it auto-reconnects and you can just repeat the command from history.