pg_recvlogical use of SIGHUP

Started by Dave Crameralmost 8 years ago4 messageshackers
Jump to latest
#1Dave Cramer
pg@fastcrypt.com

There is some undocumented (nothing in the docs) code that allows for
closing reopening the output file for pg_recvlogical.

Since this doesn't change the name of the file in the process I'm wondering
how one might actually use this "feature" ?

I could see it being useful if we were to be able to change the file name
and create a new file based on some form of template ?

Am I missing something ?

Dave Cramer

#2Andres Freund
andres@anarazel.de
In reply to: Dave Cramer (#1)
Re: pg_recvlogical use of SIGHUP

Hi,

On 2018-07-06 13:49:37 -0400, Dave Cramer wrote:

There is some undocumented (nothing in the docs) code that allows for
closing reopening the output file for pg_recvlogical.

Since this doesn't change the name of the file in the process I'm wondering
how one might actually use this "feature" ?

You can rename the file, then sighup, no? Renaming while the file is
open will continue to write into the renamed file, but sighup'ing will
use the original name.

Greetings,

Andres Freund

#3Dave Cramer
pg@fastcrypt.com
In reply to: Andres Freund (#2)
Re: pg_recvlogical use of SIGHUP

On 6 July 2018 at 14:11, Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2018-07-06 13:49:37 -0400, Dave Cramer wrote:

There is some undocumented (nothing in the docs) code that allows for
closing reopening the output file for pg_recvlogical.

Since this doesn't change the name of the file in the process I'm

wondering

how one might actually use this "feature" ?

You can rename the file, then sighup, no? Renaming while the file is
open will continue to write into the renamed file, but sighup'ing will
use the original name.

That is the missing piece, thanks!
I'll prepare a patch for the docs

Dave Cramer

#4Dave Cramer
pg@fastcrypt.com
In reply to: Dave Cramer (#3)
Re: pg_recvlogical use of SIGHUP

On 6 July 2018 at 14:11, Andres Freund <andres@anarazel.de> wrote:

Hi,

On 2018-07-06 13:49:37 -0400, Dave Cramer wrote:

There is some undocumented (nothing in the docs) code that allows for
closing reopening the output file for pg_recvlogical.

Since this doesn't change the name of the file in the process I'm

wondering

how one might actually use this "feature" ?

You can rename the file, then sighup, no? Renaming while the file is
open will continue to write into the renamed file, but sighup'ing will
use the original name.

That is the missing piece, thanks!
I'll prepare a patch for the docs

See attached patch.

Attachments:

pg_recvlogical.patchapplication/octet-stream; name=pg_recvlogical.patchDownload+6-2