[Pgpool-hackers] application_name

Tatsuo Ishii ishii at sraoss.co.jp
Tue Feb 22 04:22:44 UTC 2011


> Le 21/02/2011 09:43, Tatsuo Ishii a écrit :
>> Hi pgpool hackers,
>> 
>> We have discussed about a problem with "application_name" in
>> Paris. Pgpool keeps connection to PostgreSQL. From PostgreSQL 9.0,
>> there is a new SET variable called "application_name" which is left
>> after clients disconnects to pgpool. So if you take a look at the
>> output of pg_stat_activity, there are some entries which keep
>> application_name as "psql" if you use psql via pgpool.
>> 
>> I think we could just get ride of the problem by just adding 'SET
>> application_name TO "pgpool"' to the reset_query_list in
>> pgpool.conf(note that you should remove single quote).
>> 
>> The reason why we use double quote surrounding pgpool is,
>> reset_query_list does not allow to use single quote.
>> (maybe we should introduce some escape syntax).
>> 
>> Unfortunately pgpoolAdmin dislikes this when using pgpool.conf
>> management page but it's different story.
>> 
>> What do you think?
> 
> It's only one part of the story.
> 
> When a client disconnects from pgPool, pgPool should send the SET
> command. Just like you said.
> 
> But, when a client reconnects to pgPool, pgPool should extract the
> application_name parameter from the startup packet and send the
> application_name to PostgreSQL, so that the application_name is the good
> one.

Done.

In addition above, parameter status packet is sent to frontend.

Please note that even if two applications share same user and
database, the connection is not reused if they are using different
application_name. This is because pgpool compare the start up packet
size to decide if we could reuse existing connection. Different
application_name may differentiate the size of the start up packet.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-hackers mailing list