pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Michael Paquier <michael@paquier.xyz>
To: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Tighten error control for OpenTransientFile/CloseTransientFile
Date: Fri, 1 Mar 2019 17:05:54 -0500
Message-ID: <09ffc3a3-0e1d-91c6-7748-890b1829469a@joeconway.com> (raw)
In-Reply-To: <20190301023338.GD1348@paquier.xyz>
References: <20190301023338.GD1348@paquier.xyz>

On 2/28/19 9:33 PM, Michael Paquier wrote:
> Hi all,
> 
> Joe's message here has reminded me that we have lacked a lot of error
> handling around CloseTransientFile():
> https://www.postgresql.org/message-id/c49b69ec-e2f7-ff33-4f17-0eaa4f2cef27@joeconway.com
> 
> This has been mentioned by Alvaro a couple of months ago (cannot find
> the thread about that at quick glance), and I just forgot about it at
> that time.  Anyway, attached is a patch to do some cleanup for all
> that:
> - Switch OpenTransientFile to read-only where sufficient.
> - Add more error handling for CloseTransientFile
> A major take of this patch is to make sure that the new error messages
> generated have an elevel consistent with their neighbors.
> 
> Just on time for this last CF.  Thoughts?

Seems like it would be better to modify the arguments to
CloseTransientFile() to include the filename being closed, errorlevel,
and fail_on_error or something similar. Then all the repeated ereport
stanzas could be eliminated.

Joe

-- 
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (12+ messages)  latest in thread

Message-ID: <09ffc3a3-0e1d-91c6-7748-890b1829469a@joeconway.com>
Permalink:  ../09ffc3a3-0e1d-91c6-7748-890b1829469a@joeconway.com/
Also on:    postgresql.org/message-id/09ffc3a3-0e1d-91c6-7748-890b1829469a@joeconway.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: mail@joeconway.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org
  Subject: Re: Tighten error control for OpenTransientFile/CloseTransientFile
  In-Reply-To: <09ffc3a3-0e1d-91c6-7748-890b1829469a@joeconway.com>

* 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