O$: PostgreSQL setting the $programname property

Paul Mulroney pmulroney at logicaldevelopments.com.au
Tue Nov 7 00:41:37 UTC 2023


Hi Alex,

We want to set it dynamically, and so we're not setting it until later.  It seems that assigning $programname doesn't work.

However I found that you can execute a query eg "SET application_name TO 'my_great_app'" and it works fine, so that's what we're running with right now.

Regards,
Paul.


> On 6 Nov 2023, at 6:48 pm, Alex Clay via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> Hi Paul,
> 
> We set the application_name value on the connection before logging in to affect pg_stat_activity. For example:
> 
> Calculate voSession.$options as "application_name='my great app'"
> 
> You can combine this with other settings, such as sslmode.
> 
> This needs to be set before calling $logon.
> 
> I haven't used $programname, but it looks to do the same as setting application_name. Are you setting $programname before logging on?
> 
> Alex
> 
> 
>> On Nov 6, 2023, at 02:25, Paul Mulroney <pmulroney at logicaldevelopments.com.au> wrote:
>> 
>> Hi Everyone,
>> 
>> Has anyone tried to use the $programname property of a PGSession object?  I'd like to tell Postgres the application that's running (eg Omnis), so that I can see it in the pg_stat_activity table, but I can't seem to get it to work.
>> 
>> I'm basically doing this:
>> 
>> Calculate voSession.$programname as 'Fred'
>> 
>> Am I missing anything?
>> 
>> Regards,
>> Paul.
>> 
>> 
>> I remember the first time I saw a universal remote control … I though to myself "Well, this changes everything"
>> -- 
>> Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
>> pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
>> www.logicaldevelopments.com.au                   ACN 161 009 374 
>> Ph: +61 8 9458 3889                                       86 Coolgardie Street
>>                                                                        BENTLEY  WA  6102
>> 
>> 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 


Someone stole my mood ring. I don't know how I feel about that.
-- 
Paul W. Mulroney                                            We Don't Do Simple Pty Ltd 
pmulroney at logicaldevelopments.com.au       Trading as Logical Developments
www.logicaldevelopments.com.au                   ACN 161 009 374 
Ph: +61 8 9458 3889                                       86 Coolgardie Street
                                                                         BENTLEY  WA  6102




More information about the omnisdev-en mailing list