pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add missing_ok option to the SQL functions for reading files.
Date: Sun, 28 Jun 2015 18:39:21 +0000
Message-ID: <E1Z9HU9-0005Ru-Oa@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(-)


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


view thread (6+ messages)  latest in thread

Message-ID: <E1Z9HU9-0005Ru-Oa@gemulon.postgresql.org>
Permalink:  ../E1Z9HU9-0005Ru-Oa@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1Z9HU9-0005Ru-Oa@gemulon.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: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Add missing_ok option to the SQL functions for reading files.
  In-Reply-To: <E1Z9HU9-0005Ru-Oa@gemulon.postgresql.org>
  References: <E1Z9HU9-0005Ru-Oa@gemulon.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