Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, hlinnaka <hlinnaka(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Date: 2015-06-08 17:43:36
Message-ID: 20150608174336.GM133018@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2015-06-08 18:04:01 pgsql: Refactor WAL segment copying code.
Previous Message Robert Haas 2015-06-08 15:59:23 Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-06-08 17:44:05 Re: Restore-reliability mode
Previous Message Alvaro Herrera 2015-06-08 17:36:11 Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1