postgresql/src
Tom Lane 1b62d0fb3e Allow psql to re-use connection parameters after a connection loss.
Instead of immediately PQfinish'ing a dead connection, save it aside
so that we can still extract its parameters for \connect attempts.
(This works because PQconninfo doesn't care whether the PGconn is in
CONNECTION_BAD state.)  This allows developers to reconnect with
just \c after a database crash and restart.

It's tempting to use the same approach instead of closing the old
connection after a failed non-interactive \connect command.  However,
that would not be very safe: consider a script containing
	\c db1 user1 live_server
	\c db2 user2 dead_server
	\c db3
The script would be expecting to connect to db3 at dead_server, but
if we re-use parameters from the first connection then it might
successfully connect to db3 at live_server.  This'd defeat the goal
of not letting a script accidentally execute commands against the
wrong database.

Discussion: https://postgr.es/m/38464.1603394584@sss.pgh.pa.us
2020-10-23 17:07:15 -04:00
..
backend Fix broken XML formatting in EXPLAIN output for incremental sorts. 2020-10-23 11:32:33 -04:00
bin Allow psql to re-use connection parameters after a connection loss. 2020-10-23 17:07:15 -04:00
common Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
fe_utils Standardize the printf format for st_size 2020-09-24 21:04:21 +02:00
include Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
interfaces Add documentation and tests for quote marks in ECPG literal queries. 2020-10-22 18:29:46 -04:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Fixup some appendStringInfo and appendPQExpBuffer calls 2020-10-15 20:35:17 +13:00
port Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Use croak instead of die in Perl code when appropriate 2020-10-22 13:41:28 +02:00
timezone Update time zone data files to tzdata release 2020d. 2020-10-22 21:23:47 -04:00
tools Improve performance of Unicode {de,re}composition in the backend 2020-10-23 11:05:46 +09:00
tutorial Remove support for postfix (right-unary) operators. 2020-09-17 19:38:05 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Split Makefile symbol CFLAGS_VECTOR into two symbols. 2020-09-06 21:28:16 -04:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00