Re: Column with recycled sequence value - Mailing list pgsql-sql

From KÖPFERL Robert
Subject Re: Column with recycled sequence value
Date
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB1654E@neptun.sonorys.at
Whole thread Raw
In response to Column with recycled sequence value  (KÖPFERL Robert <robert.koepferl@sonorys.at>)
List pgsql-sql

> -----Original Message-----
> From: Andrew Sullivan [mailto:ajs@crankycanuck.ca]
> Sent: Donnerstag, 13. Jänner 2005 20:49
> To: 'pgsql-sql@postgresql.org'
> Subject: Re: [SQL] Column with recycled sequence value
>
...
> > used 2^32 will be reached soon and then? There are far less
> than 4G-records
> > saved thus these values may be reused. How can this be accomplished?
>
> You can set the sequence up to cycle (so once it gets to the end, it
> wraps around to the beginning again).  The keyword is CYCLE at CREATE
> SEQUENCE time.  It defaults to NO CYCLE.
>
> One potential problem, of course, are collisions on the table,
> because some value wasn't cleared out.  It sounds like you don't have
> that problem though.

actually I am asking just because of that.
The thing is, that I am able to synthetisize wonderful SELECTs but I have no
unterstanding of how to first find out wether a record doesn't exist in
order to create it in the same transaction. As user of procedural languages
I'm thinking of variables and so on. But AFAIK SQL has a way to also find a
way without them.
OR I'd like to read that I can't use SQL for this purpose and at minimum
PL/pgSQL would be appropriate for me.


PS. 32-Bit is my bussiness limitation - but also that is thinkable.




thanks


pgsql-sql by date:

Previous
From: Din Adrian
Date:
Subject: Trick to 'run' a view on two databases and combine the result ?
Next
From: Michael Fuhr
Date:
Subject: Re: Trick to 'run' a view on two databases and combine the result ?