Re: Making pgfdw_report_error statically analyzable

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2025-07-28T20:08:03Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Jul 28, 2025 at 10:55 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 2a. Split pgfdw_report_error into two functions, say
>> pgfdw_report_error() that hard-wires elevel as ERROR and is
>> labeled noreturn, and pgfdw_report_noerror() that has an
>> elevel argument that it asserts is less than ERROR.
>> 
>> 2b. As 2a except the two functions are pgfdw_report_error()
>> and pgfdw_report_warning(), both with hard-wired elevel values.
>> This'd be sufficient right now, but it's plausible that this path
>> would lead to needing pgfdw_report_log() and some other variants
>> in future.

> I would be fine with any of these, but my order of preference would
> probably be #2b-#1-#2a i.e. I like your most-preferred alternative
> least. However, it's a very mild preference so I am more than fine if
> you want to just go ahead and do #2a as you proposed.

The difference between 2a and 2b is just cosmetic really, so
I'm fine to go with 2b if that's the consensus.

			regards, tom lane



Commits

  1. Split up pgfdw_report_error so that we can mark it pg_noreturn.