Re: Really unique session ID - PID + connection timestamp?

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Really unique session ID - PID + connection timestamp?
Дата
Msg-id 20160409114225.GR10850@tamriel.snowman.net
обсуждение исходный текст
Ответ на Really unique session ID - PID + connection timestamp?  (Durumdara <durumdara@gmail.com>)
Список 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

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: Really unique session ID - PID + connection timestamp?
Следующее
От: Durumdara
Дата:
Сообщение: Re: Really unique session ID - PID + connection timestamp?