Search Postgresql Archives

Re: Unique Session ID in PGSQL?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pavel Stehule wrote:
>> Is there any function in PGSQL that returns an unique Session
>> identifier of the actual session?
>> For example a Bigint, or GUID, or etc?
>> Can I get the living Session identifiers from PG?
>
> try
>
> postgres=# select pg_backend_pid();
>  pg_backend_pid
> ----------------
>           17327
> (1 row)

I don't totally understand the intended use, but process IDs have the
problem that they will get reused eventually.

So if that's not good enough, you can construct a session ID like
%c in log_line_prefix with the query found in the documentation:

http://www.postgresql.org/docs/current/static/runtime-config-logging.html#GUC-LOG-LINE-PREFIX

Yours,
Laurenz Albe

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux