re: Why ALTER SUBSCRIPTION ... SET (slot_name='none') requires subscription disabled?

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: re: Why ALTER SUBSCRIPTION ... SET (slot_name='none') requires subscription disabled?
Date: 2021-07-07 17:32:15
Message-ID: CAEudQAqLtNJ1wvMKLK8ZH27SGJW5OjizgyMq28bFj-_5QG1G+A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>OTOH, when I execute ALTER SUBSCRIPTION ... SET (slot_name=''), it doesn't
complain. However,
>SELECT select pg_create_logical_replication_slot('', 'pgoutput') complains
slot name is too
>short. Although, the slot will be created at publisher, and validate the
slot name, IMO, we
>can also validate the slot_name in parse_subscription_options() to get the
error early.
>Attached fixes it. Any thoughts?
I think that this fix is better after the check if the name is equal to
"none".
Most of the time it will be "none" .
While this, reduce the overhead with strlen into
ReplicationSlotValidateName can it might be worth it.

For convenience, I have attached a new version.

regards,
Ranier Vilela

Attachment Content-Type Size
v2-validate-slot_name-in-parse_subscription_options.patch application/octet-stream 2.1 KB
reduce_overhead_strlen_replicationslotvalidatename.patch application/octet-stream 645 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2021-07-07 17:36:56 Re: Numeric x^y for negative x
Previous Message Alvaro Herrera 2021-07-07 17:30:46 Re: Pipeline mode and PQpipelineSync()