StartupMessage parameters - free-form or not?

Поиск
Список
Период
Сортировка
От Jaka Jančar
Тема StartupMessage parameters - free-form or not?
Дата
Msg-id CAMUPXmpxcyhJT-m1_TbjCYTHTsiJbmvwM9hmERsxjb+qPrxOgA@mail.gmail.com
обсуждение исходный текст
Ответы Re: StartupMessage parameters - free-form or not?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

I wrote a Postgres client and in it I allow the user to specify arbitrary StartupMessage parameters (Map<string,string>). This is convenient because the user can for example set search_path without issuing a separate SET query or encoding things into the "options" parameter. The protocol documentation also says that the latter is deprecated and what I'm doing (if I understand it right) is preferred.

A fellow author of a driver for a different language reminds me that libpq explicitly enumerates the supported parameters in the docs, and I checked the code, and indeed there is a whitelist and others are rejected. So technically, he's correct: it's nowhere documented that sending e.g. search_path in StartupMessage parameters will work, and for that matter whether everything that you can set using SET you can also send there.

What is the proper behavior for a driver here:
 1. Whitelist parameters like libpq does, or
 2. Allow the user to send anything, with the understanding it'll work the same as SET

Thanks!
Jaka

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: POC: postgres_fdw insert batching
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk