replication slot to be used in the future

Started by Tom DalPozzoover 9 years ago3 messagesgeneral
Jump to latest
#1Tom DalPozzo
t.dalpozzo@gmail.com

Hi,
I've got my primary and I make a pg_basebackup -x in order to create a
standby.
I can connect my standby only later, in some hours, so I'd like the master
to keep new WALs but I don't like to use archiving nor keep-segments
option. I thought to do it through a physical replication slot (my standby
will have its replication slot name).
So I create a physical replication slot but I see that the master, which
has never seen my standby connected to him, doesn't keep WALs.

Any idea?

Regards
Pupillo

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Tom DalPozzo (#1)
Re: replication slot to be used in the future

On 01/04/2017 08:44 AM, Tom DalPozzo wrote:

Hi,

Postgres version?

Because in 9.6:

https://www.postgresql.org/docs/9.6/static/functions-admin.html#FUNCTIONS-REPLICATION

Table 9-82. Replication SQL Functions

pg_create_physical_replication_slot(slot_name name [,
immediately_reserve boolean ])

Creates a new physical replication slot named slot_name. The optional
second parameter, when true, specifies that the LSN for this replication
slot be reserved immediately; otherwise the LSN is reserved on first
connection from a streaming replication client. Streaming changes from a
physical slot is only possible with the streaming-replication protocol —
see Section 51.3. This function corresponds to the replication protocol
command CREATE_REPLICATION_SLOT ... PHYSICAL.

I've got my primary and I make a pg_basebackup -x in order to create a
standby.
I can connect my standby only later, in some hours, so I'd like the
master to keep new WALs but I don't like to use archiving nor
keep-segments option. I thought to do it through a physical replication
slot (my standby will have its replication slot name).
So I create a physical replication slot but I see that the master, which
has never seen my standby connected to him, doesn't keep WALs.

Any idea?

Regards
Pupillo

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#3Tom DalPozzo
t.dalpozzo@gmail.com
In reply to: Adrian Klaver (#2)
Re: replication slot to be used in the future

2017-01-04 18:24 GMT+01:00 Adrian Klaver <adrian.klaver@aklaver.com>:

On 01/04/2017 08:44 AM, Tom DalPozzo wrote:

Hi,

Postgres version?

Because in 9.6:

https://www.postgresql.org/docs/9.6/static/functions-admin.h
tml#FUNCTIONS-REPLICATION

Table 9-82. Replication SQL Functions

pg_create_physical_replication_slot(slot_name name [, immediately_reserve
boolean ])

Creates a new physical replication slot named slot_name. The optional
second parameter, when true, specifies that the LSN for this replication
slot be reserved immediately; otherwise the LSN is reserved on first
connection from a streaming replication client. Streaming changes from a
physical slot is only possible with the streaming-replication protocol —
see Section 51.3. This function corresponds to the replication protocol
command CREATE_REPLICATION_SLOT ... PHYSICAL.

Hi, it is 9.5.5!
Thank you very much!

Pupillo