Re: pgsql: Optionally don't error out due to preexisting slots in commandli - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Optionally don't error out due to preexisting slots in commandli
Date
Msg-id CAB7nPqQ3o10SY6NVdU4pjq85GQTN5tbbkq2gnNUh2fBNU3rKyQ@mail.gmail.com
Whole thread Raw
In response to pgsql: Optionally don't error out due to preexisting slots in commandli  (Andres Freund <andres@anarazel.de>)
Responses Re: pgsql: Optionally don't error out due to preexisting slots in commandli  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
On Mon, Jul 13, 2015 at 5:17 AM, Andres Freund <andres@anarazel.de> wrote:
> Optionally don't error out due to preexisting slots in commandline utilities.
>
> pg_receivexlog and pg_recvlogical error out when --create-slot is
> specified and a slot with the same name already exists. In some cases,
> especially with pg_receivexlog, that's rather annoying and requires
> additional scripting.
>
> Backpatch to 9.5 as slot control functions have newly been added to
> pg_receivexlog, and there doesn't seem much point leaving it in a less
> useful state.

Andres, Coverity is pointing out that this commit missed the shot when
sqlstate is NULL in CreateReplicationSlot and this would crash.
Something like the patch attached look adapted to me, vacuumdb.c doing
the necessary checks similarly.
Regards,
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix some possible low-memory failures in regexp compilation.
Next
From: Michael Meskes
Date:
Subject: pgsql: This routine was calling ecpg_alloc to allocate to memory but di