pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor check_ functions to use filehandle for status
Date: Wed, 31 Aug 2022 11:29:59 +0000
Message-ID: <E1oTLux-000kRD-7n@gemulon.postgresql.org> (raw)

Refactor check_ functions to use filehandle for status

When reporting failure in check_ functions there is (typically) a text-
file mentioned in the error report which contains further details. Some
check_ functions kept a separate flag variable to indicate failure, and
some just checked the state of the filehandle as it's guaranteed to be
open when the check failed. This refactors the functions to consistently
do the same check on error reporting. As the error report contains the
filepath, it makes more sense to check the filehandle state and skip the
flag variable.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Bruce Momjian <bruce@momjian.us>
Discussion: https://postgr.es/m/595759F6-625B-4ED7-8125-91AF00437F83@yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cad4323cd345ec91fbe8d118436d3d50fa53c300

Modified Files
--------------
src/bin/pg_upgrade/check.c    | 30 +++++-------------------------
src/bin/pg_upgrade/function.c |  4 +---
src/bin/pg_upgrade/version.c  |  7 +------
3 files changed, 7 insertions(+), 34 deletions(-)



Message-ID: <E1oTLux-000kRD-7n@gemulon.postgresql.org>
Permalink:  ../E1oTLux-000kRD-7n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oTLux-000kRD-7n@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org
  Subject: Re: pgsql: Refactor check_ functions to use filehandle for status
  In-Reply-To: <E1oTLux-000kRD-7n@gemulon.postgresql.org>
  References: <E1oTLux-000kRD-7n@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox