pg_receivexlog --create-slot-if-not-exists

Started by Andres Freundover 10 years ago9 messages
#1Andres Freund
andres@anarazel.de

Hi,

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

Greetings,

Andres Freund

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

#2Stephen Frost
sfrost@snowman.net
In reply to: Andres Freund (#1)
Re: pg_receivexlog --create-slot-if-not-exists

* Andres Freund (andres@anarazel.de) wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

Yes, please.

Thanks!

Stephen

#3Magnus Hagander
magnus@hagander.net
In reply to: Stephen Frost (#2)
Re: pg_receivexlog --create-slot-if-not-exists

On Fri, Jun 19, 2015 at 11:17 AM, Stephen Frost <sfrost@snowman.net> wrote:

* Andres Freund (andres@anarazel.de) wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

Yes, please.

+1.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

#4Cédric Villemain
cedric@2ndQuadrant.com
In reply to: Andres Freund (#1)
Re: pg_receivexlog --create-slot-if-not-exists

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

+1 (with a shorter name please, if you can find one... )

--
C�dric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - D�veloppement, Expertise et Formation

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

#5Andres Freund
andres@anarazel.de
In reply to: Magnus Hagander (#3)
Re: pg_receivexlog --create-slot-if-not-exists

On 2015-06-19 11:19:23 -0400, Magnus Hagander wrote:

On Fri, Jun 19, 2015 at 11:17 AM, Stephen Frost <sfrost@snowman.net> wrote:

* Andres Freund (andres@anarazel.de) wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

Yes, please.

+1.

Arguably we could do that for 9.5 - the whole slot stuff for receivexlog
is new, and this is just adjusting the API slightly. I won't fight much
for that opinion though.

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

#6Cédric Villemain
cedric@2ndQuadrant.com
In reply to: Andres Freund (#5)
Re: pg_receivexlog --create-slot-if-not-exists

Le 19/06/2015 17:21, Andres Freund a �crit :

On 2015-06-19 11:19:23 -0400, Magnus Hagander wrote:

On Fri, Jun 19, 2015 at 11:17 AM, Stephen Frost <sfrost@snowman.net> wrote:

* Andres Freund (andres@anarazel.de) wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

Yes, please.

+1.

Arguably we could do that for 9.5 - the whole slot stuff for receivexlog
is new, and this is just adjusting the API slightly. I won't fight much
for that opinion though.

+1 for it in 9.5

--
C�dric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - D�veloppement, Expertise et Formation

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

#7Robert Haas
robertmhaas@gmail.com
In reply to: Cédric Villemain (#6)
Re: pg_receivexlog --create-slot-if-not-exists

On Fri, Jun 19, 2015 at 12:00 PM, Cédric Villemain
<cedric@2ndquadrant.com> wrote:

+1 for it in 9.5

If we can do it soon, sure. But not in September.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

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

#8Andres Freund
andres@anarazel.de
In reply to: Cédric Villemain (#4)
Re: pg_receivexlog --create-slot-if-not-exists

On 2015-06-19 17:21:25 +0200, C�dric Villemain wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

+1 (with a shorter name please, if you can find one... )

How about a seperate --if-not-exists modifier? Right now --create works
as an abbreviation for --create-slot, but --create-slot-if-not-exists
would break that.

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

#9Cédric Villemain
cedric@2ndQuadrant.com
In reply to: Andres Freund (#8)
Re: pg_receivexlog --create-slot-if-not-exists

Le 07/07/2015 14:55, Andres Freund a �crit :

On 2015-06-19 17:21:25 +0200, C�dric Villemain wrote:

To make slot usage in pg_receivexlog easier, should we add
--create-slot-if-not-exists? That'd mean you could run the same command
the first and later invocation.

+1 (with a shorter name please, if you can find one... )

How about a seperate --if-not-exists modifier? Right now --create works
as an abbreviation for --create-slot, but --create-slot-if-not-exists
would break that.

Having done a quick overview of other binaries provided by postgresql I
realized that pg_receivexlog is distinct from other tools creating
something at a sql level: for db, role and lang we have create and drop
as distinct commands. Both dropdb and dropuser have a '--if-exists'
(like in SQL) but have not for create operation.
Maybe we should have used createslot/dropslot in the first place and use
--if-exists --if-not-exists accordingly.
Having all in one tool, adding one or both options looks good to me.

The only alternative I see is more like "--force": return success even
if the operation was not required (create or drop).

--
C�dric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - D�veloppement, Expertise et Formation

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