pgsql: Add missing_ok option to the SQL functions for reading files.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add missing_ok option to the SQL functions for reading files.
Date: 2015-06-28 18:39:21
Message-ID: E1Z9HU9-0005Ru-Oa@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add missing_ok option to the SQL functions for reading files.

This makes it possible to use the functions without getting errors, if there
is a chance that the file might be removed or renamed concurrently.
pg_rewind needs to do just that, although this could be useful for other
purposes too. (The changes to pg_rewind to use these functions will come in
a separate commit.)

The read_binary_file() function isn't very well-suited for extensions.c's
purposes anymore, if it ever was. So bite the bullet and make a copy of it
in extension.c, tailored for that use case. This seems better than the
accidental code reuse, even if it's a some more lines of code.

Michael Paquier, with plenty of kibitzing by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cb2acb1081e13b4b27a76c6b5311115528e49c59

Modified Files
--------------
doc/src/sgml/func.sgml | 42 +++++--
src/backend/commands/extension.c | 69 ++++++++---
src/backend/utils/adt/genfile.c | 237 +++++++++++++++++++++++++++-----------
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_proc.h | 16 ++-
src/include/utils/builtins.h | 6 +-
6 files changed, 272 insertions(+), 100 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-06-28 19:17:55 pgsql: Fix double-XLogBeginInsert call in GIN page splits.
Previous Message Kevin Grittner 2015-06-28 17:48:02 pgsql: Fix comment for GetCurrentIntegerTimestamp().