Re: Making pgfdw_report_error statically analyzable

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Making pgfdw_report_error statically analyzable
Date: 2025-07-28 21:25:58
Message-ID: 202507282125.xupub6tzg23g@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Jul-28, Tom Lane wrote:

> 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.

Hmm, what about 2c. having pgfdw_report_error() with hardcoded elevel,
but complement it with pgfdw_report() that takes the elevel as argument,
asserting that it's less than ERROR? Then the calls look like
pgfdw_report(WARNING, "doo dee");

which makes sense IMO and we don't have to worry about the future.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"La experiencia nos dice que el hombre peló millones de veces las patatas,
pero era forzoso admitir la posibilidad de que en un caso entre millones,
las patatas pelarían al hombre" (Ijon Tichy)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-07-28 21:30:17 Re: Making pgfdw_report_error statically analyzable
Previous Message Jacob Champion 2025-07-28 21:21:44 Re: restore_command return code behaviour