pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: hlinnaka <hlinnaka@iki.fi>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Date: Mon, 8 Jun 2015 14:43:36 -0300
Message-ID: <20150608174336.GM133018@postgresql.org> (raw)
In-Reply-To: <CA+Tgmoa=Rs+EYviXerfxFf5ZCt=t6U-X8CrG9nadVJ_Uzgvv8g@mail.gmail.com>
References: <5571028A.1070706@dunslane.net>
	<CAA4eK1+fLqQYWKNM+arNC0QryGGQkUJ0VHUOhoLZjTRB6xJfCQ@mail.gmail.com>
	<5571251A.5090907@dunslane.net>
	<CAA4eK1J5BWSuj=n+49d2RbaxVnmec+eDRkjXSUQgTrQyShyHoA@mail.gmail.com>
	<CAA4eK1KRPRx6-h+tO4G-hTJoD_m_vUsHw_LpOAf2KYjUbT9gvg@mail.gmail.com>
	<5574E043.8060101@dunslane.net>
	<CAA4eK1Ko=OM+LxZoJzm+q7gPSsE2JVsLghGpGA0-YQ3-=kgUSw@mail.gmail.com>
	<55759407.8000801@dunslane.net>
	<CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com>
	<CA+Tgmoa=Rs+EYviXerfxFf5ZCt=t6U-X8CrG9nadVJ_Uzgvv8g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas wrote:

> Why not?  I think that if we encounter some sort of situation that we
> think should never happen, throwing an error is exactly what we
> *should* do.  Particularly when it comes to things like removing
> files, it is very dangerous for the database to proceed if the
> situation is not as expected.  We should only remove things if we are
> quite sure that removing them is the right thing to do.

Yes, agreed.

I notice that we use %m in places where I'm not sure errno is the right
thing.  Consider the ereport() at lines 10385ff, for instance.  I don't
think fgetc() nor ferror() set errno.

I became aware of this because last week I was reading some bogus
pg_dump code that reported "could not write foobar: Success" and noticed
that the macros READ_ERROR_EXIT and WRITE_ERROR_EXIT also do
strerror(errno) after doing some fread() or similar.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (74+ messages)  latest in thread

Message-ID: <20150608174336.GM133018@postgresql.org>
Permalink:  ../20150608174336.GM133018@postgresql.org/
Also on:    postgresql.org/message-id/20150608174336.GM133018@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: alvherre@2ndquadrant.com, robertmhaas@gmail.com, amit.kapila16@gmail.com, andrew@dunslane.net, hlinnaka@iki.fi, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
  In-Reply-To: <20150608174336.GM133018@postgresql.org>
  References: <5571028A.1070706@dunslane.net> <CAA4eK1+fLqQYWKNM+arNC0QryGGQkUJ0VHUOhoLZjTRB6xJfCQ@mail.gmail.com> <5571251A.5090907@dunslane.net> <CAA4eK1J5BWSuj=n+49d2RbaxVnmec+eDRkjXSUQgTrQyShyHoA@mail.gmail.com> <CAA4eK1KRPRx6-h+tO4G-hTJoD_m_vUsHw_LpOAf2KYjUbT9gvg@mail.gmail.com> <5574E043.8060101@dunslane.net> <CAA4eK1Ko=OM+LxZoJzm+q7gPSsE2JVsLghGpGA0-YQ3-=kgUSw@mail.gmail.com> <55759407.8000801@dunslane.net> <CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com> <CA+Tgmoa=Rs+EYviXerfxFf5ZCt=t6U-X8CrG9nadVJ_Uzgvv8g@mail.gmail.com> <20150608174336.GM133018@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