RE: Allow escape in application_name - Mailing list pgsql-hackers

From kuroda.hayato@fujitsu.com
Subject RE: Allow escape in application_name
Date
Msg-id TYAPR01MB58662175F7FEF5B6A1E6F1E8F5429@TYAPR01MB5866.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Allow escape in application_name  (Masahiko Sawada <sawada.mshk@gmail.com>)
Responses Re: Allow escape in application_name  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
Dear Sawada-san,

> Good idea. But the application_name is actually truncated to 63
> characters (NAMEDATALEN - 1)? If so, we need to do substring(... for
> 63) instead.

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.
```

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()
```

Best Regards,
Hayato Kuroda
FUJITSU LIMITED


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Emit a warning if the extension's GUC is set incorrectly
Next
From: "Imseih (AWS), Sami"
Date:
Subject: Re: Add index scan progress to pg_stat_progress_vacuum