pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Fujii Masao <fujii@postgresql.org>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: stopgap fix for signal handling during restore_command
Date: Tue, 28 Feb 2023 20:36:03 -0800
Message-ID: <20230301043603.GD1453450@nathanxps13> (raw)
In-Reply-To: <20230226201227.cner3cdicropu4q5@awork3.anarazel.de>
References: <20230223231503.GA743455@nathanxps13>
	<CA+hUKG+d+u2BZu=N4q15EbR7s52KugSQeQ8eUXE8iuEBe108ng@mail.gmail.com>
	<20230224043323.GA821522@nathanxps13>
	<20230225190742.lfopue3nkrvxxoie@awork3.anarazel.de>
	<20230225192825.GA868928@nathanxps13>
	<20230225195253.hzp6pyllhn4kw4g6@awork3.anarazel.de>
	<20230225220629.GA1021641@nathanxps13>
	<20230226180029.djk7cth4o3o5doom@awork3.anarazel.de>
	<20230226193900.GA1248604@nathanxps13>
	<20230226201227.cner3cdicropu4q5@awork3.anarazel.de>

On Sun, Feb 26, 2023 at 12:12:27PM -0800, Andres Freund wrote:
> On 2023-02-26 11:39:00 -0800, Nathan Bossart wrote:
>> What precisely did you have in mind?  AFAICT you are asking for a wrapper
>> around write().
> 
> Partially I just want something that can easily be searched for, that can have
> comments attached to it documenting why what it is doing is safe.
> 
> It'd not be a huge amount of work to have a slow and restricted string
> interpolation support, to make it easier to write messages. Converting floats
> is probably too hard to do safely, and I'm not sure %m can safely be
> supported. But basic things like %d would be pretty simple.
> 
> Basically a loop around the format string that directly writes to stderr using
> write(), and only supports a signal safe subset of normal format strings.

Got it, thanks.  I will try to put something together along these lines,
although I don't know if I'll pick up the interpolation support in this
thread.

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com





view thread (29+ messages)  latest in thread

Message-ID: <20230301043603.GD1453450@nathanxps13>
Permalink:  ../20230301043603.GD1453450@nathanxps13/
Also on:    postgresql.org/message-id/20230301043603.GD1453450@nathanxps13

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, andres@anarazel.de, thomas.munro@gmail.com, michael@paquier.xyz, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, fujii@postgresql.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: stopgap fix for signal handling during restore_command
  In-Reply-To: <20230301043603.GD1453450@nathanxps13>

* 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