pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: tobias.gierke@code-sourcery.de
Subject: BUG #15747: Help says 'application_name' property supports 64 characters in a standard built but it's only 63
Date: Thu, 11 Apr 2019 08:53:43 +0000
Message-ID: <15747-b6b8a12dcc12790b@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15747
Logged by:          Tobias Gierke
Email address:      tobias.gierke@code-sourcery.de
PostgreSQL version: 11.2
Operating system:   CentOS 7 (PG 11.2 compiled from sources)
Description:        

According to
https://www.postgresql.org/docs/current/runtime-config-logging.html
'application_name' can be up 64 characters long:

"The application_name can be any string of less than NAMEDATALEN characters
(64 characters in a standard build)."

We tried to set a longer application name - PostgreSQL actually truncates
the name to 63 characters (probably because of the terminating 0-byte taking
up the 64th slot). 

db=# set
application_name='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
will be truncated to
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SET
db=# select
length('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 length 
--------
     63
(1 row)

db=# select '>' || application_name || '<' from pg_stat_activity where
application_name like 'xxx%';
                             ?column?                              
-------------------------------------------------------------------
 >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<
(1 row)

db=# select
length('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 length 
--------
     63
(1 row)



view thread (3+ messages)  latest in thread

Message-ID: <15747-b6b8a12dcc12790b@postgresql.org>
Permalink:  ../15747-b6b8a12dcc12790b@postgresql.org/
Also on:    postgresql.org/message-id/15747-b6b8a12dcc12790b@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, tobias.gierke@code-sourcery.de
  Subject: Re: BUG #15747: Help says 'application_name' property supports 64 characters in a standard built but it's only 63
  In-Reply-To: <15747-b6b8a12dcc12790b@postgresql.org>
  References: <15747-b6b8a12dcc12790b@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox