Re: Replication connection URI?

Поиск
Список
Период
Сортировка
От Alex Shulgin
Тема Re: Replication connection URI?
Дата
Msg-id 87tx1or3cc.fsf@commandprompt.com
обсуждение исходный текст
Ответ на Re: Replication connection URI?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: Replication connection URI?  (Alex Shulgin <ash@commandprompt.com>)
Missing OOM checks in libpq (was Re: Replication connection URI?)  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Re: Replication connection URI?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
>>
>> It appears that replication connection doesn't support URI but only the
>> traditional conninfo string.
>>
>> src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:99: in libpqrcv_connect():
>>
>>      snprintf(conninfo_repl, sizeof(conninfo_repl),
>>               "%s dbname=replication replication=true fallback_application_name=walreceiver",
>>               conninfo);
>>
>> A patch to fix this welcome?
>
> Yeah, seems like an oversight. Hopefully you can fix that without
> teaching libpqwalreceiver what connection URIs look like..

Please see attached.  We're lucky that PQconnectdbParams has an option
to parse and expand the first dbname parameter if it looks like a
connection string (or a URI).

The first patch is not on topic, I just spotted this missing check.

The second one is a self-contained fix, but the third one which is the
actual patch depends on the second one, because it specifies the dbname
keyword two times: first to parse the conninfo/URI, then to override any
dbname provided by the user with "replication" pseudo-database name.

Have a nice day!
--
Alex


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_class(relpersistence) of hash index
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Turning recovery.conf into GUCs