pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedDrivers users by connections
2+ messages / 2 participants
[nested] [flat]
* Drivers users by connections
@ 2023-06-06 07:18 Hrishikesh (Richie) Rode <hrode@livevox.com>
0 siblings, 1 reply; 2+ messages in thread
From: Hrishikesh (Richie) Rode @ 2023-06-06 07:18 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; +Cc: Rag Krishnan <rkrishnan@livevox.com>
Hello
We are not able to find table which give session connection details about drivers. In pg_stat_activity details information is not there. Please let us know where we can find these information.
Please help me to get this information.
Thanks
Richie-
In Oracle and Mysql we use below sql to get details
SQL used to get mysql driver connection details
SELECT SUBSTRING_INDEX(s.user,"@",1),sca.attr_value
FROM sys.session as s
join performance_schema.session_connect_attrs as sca
on s.conn_id = sca.processlist_id
group by SUBSTRING_INDEX(s.user,"@",1)
SQL used to get Oracle driver connection details
select a.CLIENT_VERSION, a.CLIENT_DRIVER ,b.USERNAME,b.PROGRAM
from v$session_connect_info a, v$session b
where CLIENT_VERSION!='Unknown' and CLIENT_DRIVER is not null
and a.sid=b.sid
group by a.CLIENT_VERSION, a.CLIENT_DRIVER ,b.USERNAME,b.PROGRAM
order by b.USERNAME
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Drivers users by connections
@ 2023-06-06 11:20 Erik Wienhold <ewie@ewie.name>
parent: Hrishikesh (Richie) Rode <hrode@livevox.com>
0 siblings, 0 replies; 2+ messages in thread
From: Erik Wienhold @ 2023-06-06 11:20 UTC (permalink / raw)
To: Hrishikesh (Richie) Rode <hrode@livevox.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; +Cc: Rag Krishnan <rkrishnan@livevox.com>
> On 06/06/2023 09:18 CEST Hrishikesh (Richie) Rode <hrode@livevox.com> wrote:
>
> We are not able to find table which give session connection details about
> drivers. In pg_stat_activity details information is not there. Please let us
> know where we can find these information.
Column pg_stat_activity.application_name is the only one I know of that may
provide such details. But it relies on the driver setting application_name
when connecting. Some drivers set a default, e.g. pgjdbc, but also allow
overriding with a custom application name that may include additional info
such as driver version. But in the end application_name is just text without
any inherent structure.
--
Erik
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-06-06 11:20 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06 07:18 Drivers users by connections Hrishikesh (Richie) Rode <hrode@livevox.com>
2023-06-06 11:20 ` Erik Wienhold <ewie@ewie.name>
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