postgres/src
Peter Geoghegan 1a990b207b Have BufFileSize() ereport() on FileSize() failure.
Move the responsibility for checking for and reporting a failure from
the only current BufFileSize() caller, logtape.c, to BufFileSize()
itself.  Code within buffile.c is generally responsible for interfacing
with fd.c to report irrecoverable failures.  This seems like a
convention that's worth sticking to.

Reorganizing things this way makes it easy to make the error message
raised in the event of BufFileSize() failure descriptive of the
underlying problem.  We're now clear on the distinction between
temporary file name and BufFile name, and can show errno, confident that
its value actually relates to the error being reported.  In passing, an
existing, similar buffile.c ereport() + errcode_for_file_access() site
is changed to follow the same conventions.

The API of the function BufFileSize() is changed by this commit, despite
already being in a stable release (Postgres 11).  This seems acceptable,
since the BufFileSize() ABI was changed by commit aa55183042, which
hasn't made it into a point release yet.  Besides, it's difficult to
imagine a third party BufFileSize() caller not just raising an error
anyway, since BufFile state should be considered corrupt when
BufFileSize() fails.

Per complaint from Tom Lane.

Discussion: https://postgr.es/m/26974.1540826748@sss.pgh.pa.us
Backpatch: 11-, where shared BufFiles were introduced.
2018-11-28 14:42:54 -08:00
..
backend Have BufFileSize() ereport() on FileSize() failure. 2018-11-28 14:42:54 -08:00
bin Use wildcard to match parens after CREATE STATISTICS 2018-11-28 00:48:51 +01:00
common Make spelling of "acknowledgment" consistent 2018-10-15 10:06:45 +02:00
fe_utils Fix translation of special characters in psql's LaTeX output modes. 2018-11-26 17:32:51 -05:00
include Add CSV table output mode in psql. 2018-11-26 15:18:55 -05:00
interfaces Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
makefiles Revert all new recent changes to add PGXS options for TAP and isolation 2018-11-26 11:12:11 +09:00
pl Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
port Integrate recovery.conf into postgresql.conf 2018-11-25 16:33:40 +01:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Only allow one recovery target setting 2018-11-28 13:55:54 +01:00
timezone Sync our copy of the timezone library with IANA release tzcode2018g. 2018-10-31 09:47:53 -04:00
tools Remove WITH OIDS support, change oid catalog column visibility. 2018-11-20 16:00:17 -08:00
tutorial Deduplicate "invalid input syntax" messages for various types. 2018-07-22 14:58:01 -07:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Remove useless symbol from Makefile.global. 2018-11-06 10:57:51 -05:00
Makefile.shlib Don't build static libraries on Cygwin 2018-10-02 16:46:57 -04:00
nls-global.mk