Re: Don'st start streaming after creating a slot in pg_receivexlog

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Don'st start streaming after creating a slot in pg_receivexlog
Date: 2015-07-29 08:23:43
Message-ID: CANP8+jLWzd5_O9+CXMrr2kOg4sVaik+1sXRBrq6GTQ+4XAP33g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29 July 2015 at 09:01, Andres Freund <andres(at)anarazel(dot)de> wrote:

> On 2015-07-29 08:54:40 +0100, Simon Riggs wrote:
> > --drop-slot seems pointless, since you can just do that with psql
> >
> > If we make --create-slot do nothing but add the slot, then that seems
> > pointless also
>
> > Would we need to add those options to all commands, when it can be done
> > with psql?
>
> They work over the replication protocol, which is handy, because it can
> be done with the same user/permissions as the normal pg_receivexlog.
>

It's useful to separate permissions for creating/dropping a slot from using
it. A one-time act configures (or re-configures) how you wish the cluster
to look, another more regular task is to connect to the slot and use it.
But if you want to have a single user with privileges for both, you can
create that. I don't see it as something that we need to support in the
replication protocol, since that would require us to extend it every time
we think of something else.

Creating a temporary slot goes against the whole concept of slots, so using
the same id in the same script isn't actually needed, except maybe to
simplify testing.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shulgin, Oleksandr 2015-07-29 09:40:30 Re: Don'st start streaming after creating a slot in pg_receivexlog
Previous Message Simon Riggs 2015-07-29 08:17:04 Re: pg_basebackup and replication slots