postgresql/src
Tom Lane a5dbca460a Don't fail on libpq-generated error reports in ecpg_raise_backend().
An error PGresult generated by libpq itself, such as a report of
connection loss, won't have broken-down error fields.
ecpg_raise_backend() blithely assumed that PG_DIAG_MESSAGE_PRIMARY
would always be present, and would end up passing a NULL string
pointer to snprintf when it isn't.  That would typically crash
before 3779ac62d, and it would fail to provide a useful error report
in any case.  Best practice is to substitute PQerrorMessage(conn)
in such cases, so do that.

Per bug #17421 from Masayuki Hirose.  Back-patch to all supported
branches.

Discussion: https://postgr.es/m/17421-790ff887e3188874@postgresql.org
2022-06-06 11:20:31 -04:00
..
backend Silence compiler warnings from some older compilers. 2022-06-01 17:21:45 -04:00
bin Fix psql's single transaction mode on client-side errors with -c/-f switches 2022-06-06 11:07:22 +09:00
common Inhibit mingw CRT's auto-globbing of command line arguments 2022-04-25 15:49:35 -04:00
fe_utils Allow db.schema.table patterns, but complain about random garbage. 2022-04-20 11:39:44 -04:00
include Repurpose PROC_COPYABLE_FLAGS as PROC_XMIN_FLAGS 2022-05-19 16:20:32 +02:00
interfaces Don't fail on libpq-generated error reports in ecpg_raise_backend(). 2022-06-06 11:20:31 -04:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Fix pl/perl test case so it will still work under Perl 5.36. 2022-06-01 16:15:47 -04:00
port Fix compatibility thinko for fstat() on standard streams in win32stat.c 2021-11-30 09:55:56 +09:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Show 'AS "?column?"' explicitly when it's important. 2022-05-21 14:45:58 -04:00
timezone Update time zone data files to tzdata release 2022a. 2022-05-05 14:55:03 -04:00
tools Improve setup of environment values for commands in MSVC's vcregress.pl 2022-05-11 10:22:29 +09:00
tutorial doc: Prefer explicit JOIN syntax over old implicit syntax in tutorial 2021-04-08 10:51:26 +02: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 Add module build directory to the PATH for TAP tests 2021-10-22 09:50:16 -04:00
Makefile.shlib AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS. 2021-09-06 11:28:02 -07:00
nls-global.mk Add errhint_plural() function and make use of it 2021-03-31 09:16:25 +02:00