postgres/contrib/postgres_fdw
Tom Lane 74e121c8dc Split up pgfdw_report_error so that we can mark it pg_noreturn.
pgfdw_report_error has the same design fault as elog/ereport
do, namely that it might or might not return depending on elevel.
While those functions are too widely used to redesign, there are
only about 30 call sites for pgfdw_report_error, and it's not
exposed for extension use.  So let's rethink it.  Split it into
pgfdw_report_error() which hard-wires ERROR elevel and is marked
pg_noreturn, and pgfdw_report() which allows only elevels less
than ERROR.  (Thanks to Álvaro Herrera for suggesting this naming.)

The motivation for doing this now is that in the wake of commit
80aa9848b, which removed a bunch of PG_TRYs from postgres_fdw,
we're seeing more thorough flow analysis there from C compilers
and Coverity.  Marking pgfdw_report_error as noreturn where
appropriate should help prevent false-positive complaints.

We could alternatively have invented a macro wrapper similar
to what we use for elog/ereport, but that code is sufficiently
fragile that I didn't find it appetizing to make another copy.
Since 80aa9848b already changed pgfdw_report_error's signature,
this won't make back-patching any harder than it was already.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/420221.1753714491@sss.pgh.pa.us
2025-07-29 10:35:01 -04:00
..
expected Reduce "Var IS [NOT] NULL" quals during constant folding 2025-07-22 11:21:36 +09:00
sql Reduce "Var IS [NOT] NULL" quals during constant folding 2025-07-22 11:21:36 +09:00
t Fix typos and grammar in the code 2025-04-19 19:17:42 +09:00
.gitignore
connection.c Split up pgfdw_report_error so that we can mark it pg_noreturn. 2025-07-29 10:35:01 -04:00
deparse.c Fix a typo in the deparseArrayCoerceExpr() header comment 2025-07-18 18:40:07 +03:00
Makefile postgres_fdw: SCRAM authentication pass-through 2025-01-15 17:58:05 +01:00
meson.build meson: Increase minimum version to 0.57.2 2025-07-02 11:14:53 +02:00
option.c Silence leakage complaint about postgres_fdw's InitPgFdwOptions. 2025-07-25 16:37:29 -04:00
postgres_fdw--1.1--1.2.sql postgres_fdw: Extend postgres_fdw_get_connections to return remote backend PID. 2025-03-03 08:51:30 +09:00
postgres_fdw--1.0--1.1.sql postgres_fdw: Add functions to discard cached connections. 2021-01-26 15:35:54 +09:00
postgres_fdw--1.0.sql
postgres_fdw.c Split up pgfdw_report_error so that we can mark it pg_noreturn. 2025-07-29 10:35:01 -04:00
postgres_fdw.control postgres_fdw: Add "used_in_xact" column to postgres_fdw_get_connections(). 2024-07-26 22:15:51 +09:00
postgres_fdw.h Split up pgfdw_report_error so that we can mark it pg_noreturn. 2025-07-29 10:35:01 -04:00
shippable.c Update copyright for 2025 2025-01-01 11:21:55 -05:00