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

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Durumdara <durumdara(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Really unique session ID - PID + connection timestamp?
Date: 2016-04-09 14:05:24
Message-ID: 57090C24.7060805@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/09/2016 01:30 AM, Durumdara wrote:
> Dear Everybody!
>
>
> In MS we had a "persistent lock" structure and method.
> This over transactions because based on real records in a real table
> with pri key (tablename + id).
>
> For garbaging we had a special session info.
> In MS the session id is smallint, so it can repeats after server
> restarts, but my coll. found a "session creation timestamp".
> This is a key which unique.
> With this we can check for died sessions and we can clean their records.

It might help to explain more what it is you are trying to achieve.

First I am not sure what you mean by 'persistent lock', especially as it
applies to Postgres?

Second, I assume by garbaging you mean garbage collection of something?
If that is the case what exactly are you garbage collecting?
I see 'clean records', what records would these be?
In particular, on Postgres, where are you going to do this?

>
> We want create same mechanism.

If the above questions did not already cover this, what mechanism?

> I know there are adv. locks in PG, but I want to use session id.
>
> This could be:
> |pg_backend_pid|()
>
> May pid repeats.
> Where I can get timestamp or some other unique data with I can create a
> combined primary key?
>
> Thanks for your help!
>
> dd
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2016-04-09 14:29:37 Re: Bypassing NULL elements in row_to_json function
Previous Message Adrian Klaver 2016-04-09 13:56:52 Re: 9.5 - Is there any way to disable automatic rollback?