Re: Allow escape in application_name

Поиск
Список
Период
Сортировка
От Masahiko Sawada
Тема Re: Allow escape in application_name
Дата
Msg-id CAD21AoAcnynacMVr7U2TC=eMtxSdxRZLG6RS7uEunoSfdyux-g@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Allow escape in application_name  ("kuroda.hayato@fujitsu.com" <kuroda.hayato@fujitsu.com>)
Ответы Re: Allow escape in application_name  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Список pgsql-hackers
On Tue, Dec 28, 2021 at 8:57 AM kuroda.hayato@fujitsu.com
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Sawada-san,
>
> > If so, we need to do substring(... for
> > 63) instead.

Just to be clear, I meant substring(... for NAMEDATALEN - 1).

>
> Yeah, the parameter will be truncated as one less than NAMEDATALEN:
>
> ```
> max_identifier_length (integer)
> Reports the maximum identifier length. It is determined as one less than the value of NAMEDATALEN when building the
server.
> The default value of NAMEDATALEN is 64; therefore the default max_identifier_length is 63 bytes,
> which can be less than 63 characters when using multibyte encodings.
> ```

I think this is the description of the max_identifier_length GUC parameter.

>
> But in Fujii-san's patch length is picked up by the following SQL, so I think it works well.
>
> ```
> SELECT max_identifier_length FROM pg_control_init()
> ```

Doesn't this query return 64? So the expression "substring(str for
(SELECT max_identifier_length FROM pg_control_init()))" returns the
first 64 characters of the given string while the application_name is
truncated to be 63 (NAMEDATALEN - 1) characters. It also seems to be
fine to use current_setting('max_identifier_length') instead of
max_identifier_length of pg_control_init().

Regards,

-- 
Masahiko Sawada
EDB:  https://www.enterprisedb.com/



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

Предыдущее
От: "Imseih (AWS), Sami"
Дата:
Сообщение: Re: Add index scan progress to pg_stat_progress_vacuum
Следующее
От: SATYANARAYANA NARLAPURAM
Дата:
Сообщение: Re: Throttling WAL inserts when the standby falls behind more than the configured replica_lag_in_bytes