Thread

  1. libpq: Add PQapplicationname() function

    songjinzhou <tsinghualucky912@foxmail.com> — 2025-04-29T11:22:02Z

    Dear hackers, here is a libpq function: PQapplicationname(), I think it may be of some use.&nbsp;
    
    
    Looking forward to your reply, thank you.
  2. Re: libpq: Add PQapplicationname() function

    Japin Li <japinli@hotmail.com> — 2025-04-29T15:13:35Z

    On Tue, 29 Apr 2025 at 19:22, "songjinzhou" <tsinghualucky912@foxmail.com> wrote:
    > Dear hackers, here is a libpq function: PQapplicationname(), I think it may be of some use. 
    >
    > Looking forward to your reply, thank you.
    >
    
    I believe the use cases for this are narrow.
    
    Generally, clients set the application_name and then don't need to
    retrieve it.  Its primary use seems to be on the server-side, for
    monitoring through pg_stat_activity.
    
    Could you explain your use case?
    
    Assuming we do require this functionality, should we then also consider
    the interplay between application_name and fallback_application_name?
    Additionally, if a SET application_name TO xxx command is issued during
    a subsequent connection, will the appname field within the PGconn structure
    be updated promptly?
    
    -- 
    Regrads,
    Japin Li
    
    
    
    
  3. Re: libpq: Add PQapplicationname() function

    David G. Johnston <david.g.johnston@gmail.com> — 2025-04-29T15:27:05Z

    On Tuesday, April 29, 2025, songjinzhou <tsinghualucky912@foxmail.com>
    wrote:
    
    > Dear hackers, here is a libpq function: PQapplicationname(), I think it
    > may be of some use.
    >
    
    You really should provide at least one reasoned use case for why this
    should exist.
    
    
    >
    > Looking forward to your reply, thank you.
    >
    >
    This isn’t even the correct code to use for this.  PQparameterStatus is
    where you’d access application_name.  I don’t see a good reason in
    providing multiple ways to get access to the same data value.
    
    David J.