Re: Really unique session ID - PID + connection timestamp? - Mailing list pgsql-general

From Stephen Frost
Subject Re: Really unique session ID - PID + connection timestamp?
Date
Msg-id 20160409114225.GR10850@tamriel.snowman.net
Whole thread Raw
In response to Really unique session ID - PID + connection timestamp?  (Durumdara <durumdara@gmail.com>)
List pgsql-general
Greetings,

* Durumdara (durumdara@gmail.com) wrote:
> Where I can get timestamp or some other unique data with I can create a
> combined primary key?

Not entirely sure about the rest of it, but if you want backend start
time, you can look at pg_stat_activity (which also happens to have the
pid).

If you want just your own, combine it with pg_backend_pid, as in:

select
  pid || ',' || backend_start
from pg_stat_activity where pid = pg_backend_pid();

Thanks!

Stephen

Attachment

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Really unique session ID - PID + connection timestamp?
Next
From: Durumdara
Date:
Subject: Re: Really unique session ID - PID + connection timestamp?