Multiple Sequence Number for One Column p.2

From: alexander <aleksiyantsa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Multiple Sequence Number for One Column p.2
Date: 2016-02-02 11:28:29
Message-ID: 56B092DD.7070203@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I've met exactly the same problem as described here
http://www.postgresql.org/message-id/95862fdc-eb2e-4533-8331-d49775b0ef8f@f2g2000yqf.googlegroups.com
. For now, I use the same solution that was presented in the response
http://www.postgresql.org/message-id/077DA5F9-F783-4388-BF19-42E582DC89EE@yahoo.com
.

In my case, I have a composite key composed of session ID and object ID.
Session ID is a unique value. I'd like to have a separate auto
incremental key for each session ID value. Therefore, I create a
sequence for each session ID. The problem is that once the session has
ended there won't be new values with its session ID, so, we have to
clear obsolete sequences related to this ID from time to time.

It's said in the last message that there are other solutions. It would
be helpful for me to know the others if they exist in terms of PostgreSQL.

Thanks in advance,
Alexander Aleksiyants.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yu Nie 2016-02-02 15:00:41 Re: strange sql behavior
Previous Message Craig Ringer 2016-02-02 08:42:08 Re: BDR error trying to replay a invalid statement