| From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
|---|---|
| To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Allow GUC settings in CREATE SUBSCRIPTION CONNECTION to take effect |
| Date: | 2025-12-02 12:08:03 |
| Message-ID: | CAA4eK1KR8-0DC-+bdSEzfw7oiYn=M6D3PpNjbaohwpFRRZ9y3A@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, Nov 18, 2025 at 9:29 PM Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
> In logical replication, any GUC settings specified in the CONNECTION clause of
> CREATE SUBSCRIPTION are currently ignored. For example:
>
> CREATE SUBSCRIPTION mysub
> CONNECTION 'options=''-c wal_sender_timeout=1000'''
> PUBLICATION ...
>
> The wal_sender_timeout value here has no effect.
>
> This is inconvenient when different logical replication walsenders need
> different settings - e.g., a small wal_sender_timeout for walsender
> connecting to a nearby subscriber and a larger one for walsender
> connecting to a distant subscriber. Right now, it's not easy for users
> to control such per-connection behavior.
>
> The reason of thid limitation is that libpqrcv_connect() always overwrites
> the options connection parameter as follows:
>
> keys[++i] = "options";
> vals[i] = "-c datestyle=ISO -c intervalstyle=postgres -c
> extra_float_digits=3";
>
> This wipes out any user-specified GUCs in the CONNECTION string.
> Physical replication does not have this problem because it does not overwrite
> options, so GUCs in primary_conninfo are honored.
>
> To remove this restriction, how about switching to issuing SET commands for
> datestyle, intervalstyle, and extra_float_digits after the connection
> is established,
> similar to what postgres_fdw does, instead of forcing them into options?
> That would allow user-specified GUC settings in CREATE SUBSCRIPTION to
> take effect.
>
Is it possible that we append the predefined options to the options
given by the user to avoid extra round-trip?
--
With Regards,
Amit Kapila.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jakub Wartak | 2025-12-02 12:26:33 | Re: Adding basic NUMA awareness |
| Previous Message | Matthias van de Meent | 2025-12-02 12:02:32 | Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements |