Re: protocol support for labels

Поиск
Список
Период
Сортировка
От Nico Williams
Тема Re: protocol support for labels
Дата
Msg-id Z9CI8B1bYF+u63pq@ubby
обсуждение исходный текст
Ответ на Re: protocol support for labels  (Frits Hoogland <frits.hoogland@gmail.com>)
Ответы Re: protocol support for labels
Список pgsql-hackers
On Tue, Mar 11, 2025 at 05:23:14PM +0100, Frits Hoogland wrote:
> The usecase that I think might be useful is to have a database client send metadata along with a query.
> This partially is possible today by setting application_name, but that is a separate request, it would be great if
thatcould be sent along with the query in one go.
 
> Another option to pass metadata is to add a comment (/* .. */), but a comment cannot be set for a prepared statement,
becausethe statement is prepared first and then later invoked on runtime, which executes a query that is fixed.
 

How about using a `set_config()` to deonte the "application_name" (and
any other details) for the _next_ query, then have those details appear
in the pg_stat_statements rows and logs?

Clients would send a `SELECT set_config(...)` and also the next query
one after the other without waiting for the response to the first.  The
server could similarly batch the two responses.

Look ma', no protocol change.

Nico
-- 



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