pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add missing_ok option to the SQL functions for reading files.
6+ messages / 3 participants
[nested] [flat]

* pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-06-28 18:39  Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 1 reply; 6+ messages in thread

From: Heikki Linnakangas @ 2015-06-28 18:39 UTC (permalink / raw)
  To: 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(-)


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


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-07-05 11:44  Michael Paquier <michael.paquier@gmail.com>
  parent: Heikki Linnakangas <heikki.linnakangas@iki.fi>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Paquier @ 2015-07-05 11:44 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki.linnakangas@iki.fi>; +Cc: pgsql-committers

On Mon, Jun 29, 2015 at 3:39 AM, Heikki Linnakangas
<heikki.linnakangas@iki.fi> wrote:
> 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.

This has been done done as the part of a fix for the issues with
pg_rewind, but perhaps it should be mentioned in the release notes?
-- 
Michael


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-08-28 12:39  Bruce Momjian <bruce@momjian.us>
  parent: Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Bruce Momjian @ 2015-08-28 12:39 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>; pgsql-committers

On Sun, Jul  5, 2015 at 08:44:41PM +0900, Michael Paquier wrote:
> On Mon, Jun 29, 2015 at 3:39 AM, Heikki Linnakangas
> <heikki.linnakangas@iki.fi> wrote:
> > 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.
> 
> This has been done done as the part of a fix for the issues with
> pg_rewind, but perhaps it should be mentioned in the release notes?

Yes, I will pick up that change during the creation of the 9.6 release
notes.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-08-28 12:41  Michael Paquier <michael.paquier@gmail.com>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Paquier @ 2015-08-28 12:41 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>; pgsql-committers

On Fri, Aug 28, 2015 at 9:39 PM, Bruce Momjian <bruce@momjian.us> wrote:
> On Sun, Jul  5, 2015 at 08:44:41PM +0900, Michael Paquier wrote:
>> On Mon, Jun 29, 2015 at 3:39 AM, Heikki Linnakangas
>> <heikki.linnakangas@iki.fi> wrote:
>> > 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.
>>
>> This has been done done as the part of a fix for the issues with
>> pg_rewind, but perhaps it should be mentioned in the release notes?
>
> Yes, I will pick up that change during the creation of the 9.6 release
> notes.

Even if it has been introduced in 9.5?
-- 
Michael


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-08-28 14:17  Bruce Momjian <bruce@momjian.us>
  parent: Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Bruce Momjian @ 2015-08-28 14:17 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>; pgsql-committers

On Fri, Aug 28, 2015 at 09:41:08PM +0900, Michael Paquier wrote:
> On Fri, Aug 28, 2015 at 9:39 PM, Bruce Momjian <bruce@momjian.us> wrote:
> > On Sun, Jul  5, 2015 at 08:44:41PM +0900, Michael Paquier wrote:
> >> On Mon, Jun 29, 2015 at 3:39 AM, Heikki Linnakangas
> >> <heikki.linnakangas@iki.fi> wrote:
> >> > 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.
> >>
> >> This has been done done as the part of a fix for the issues with
> >> pg_rewind, but perhaps it should be mentioned in the release notes?
> >
> > Yes, I will pick up that change during the creation of the 9.6 release
> > notes.
> 
> Even if it has been introduced in 9.5?

Well, this is where I got lost then, because I only see it going into
master, which, uh, I thought was 9.6, but I am now realizing this was
committed before we branched.  :-(  This will be picked up when the 9.5
release notes are updated to match git.

Actually, I now see this in the 9.5 release notes:

   <simpara>Current as of 2015-08-03</simpara>

This was updated by Tom:

	ecc2d16b (Tom Lane         2015-08-03 12:29:10 -0400   10)   <simpara>Current as of 2015-08-03</simpara>

and I see Tom added it properly:

	<!--
	2015-06-28 [cb2acb1] Heikki..: Add missing_ok option to the SQL functions for..
	-->
	       <para>
	        Add an optional <replaceable>missing_ok</> argument to <link
	        linkend="functions-admin-genfile-table"><function>pg_read_file()</></>
	        and related functions (Michael Paquier, Heikki Linnakangas)
	       </para>
	      </listitem>

so, after all that detail, I think we are good.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pgsql: Add missing_ok option to the SQL functions for reading files.
@ 2015-08-28 14:21  Bruce Momjian <bruce@momjian.us>
  parent: Bruce Momjian <bruce@momjian.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2015-08-28 14:21 UTC (permalink / raw)
  To: Michael Paquier <michael.paquier@gmail.com>; +Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>; pgsql-committers

On Fri, Aug 28, 2015 at 10:17:44AM -0400, Bruce Momjian wrote:
> and I see Tom added it properly:
> 
> 	<!--
> 	2015-06-28 [cb2acb1] Heikki..: Add missing_ok option to the SQL functions for..
> 	-->
> 	       <para>
> 	        Add an optional <replaceable>missing_ok</> argument to <link
> 	        linkend="functions-admin-genfile-table"><function>pg_read_file()</></>
> 	        and related functions (Michael Paquier, Heikki Linnakangas)
> 	       </para>
> 	      </listitem>
> 
> so, after all that detail, I think we are good.

I think the crux of the issue is that I am coming to these emails late,
and much of the maintenance is happening with little visibility.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +


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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2015-08-28 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-06-28 18:39 pgsql: Add missing_ok option to the SQL functions for reading files. Heikki Linnakangas <heikki.linnakangas@iki.fi>
2015-07-05 11:44 ` Michael Paquier <michael.paquier@gmail.com>
2015-08-28 12:39   ` Bruce Momjian <bruce@momjian.us>
2015-08-28 12:41     ` Michael Paquier <michael.paquier@gmail.com>
2015-08-28 14:17       ` Bruce Momjian <bruce@momjian.us>
2015-08-28 14:21         ` Bruce Momjian <bruce@momjian.us>

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