X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8D0B33A18CE for ; Fri, 14 Jan 2005 10:14:04 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46674-06 for ; Fri, 14 Jan 2005 10:13:54 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id E65213A18F5 for ; Fri, 14 Jan 2005 10:13:54 +0000 (GMT) Received: (qmail-ldap/ctrl 39643 invoked from network); 14 Jan 2005 10:13:52 -0000 Received: from unknown (HELO jupiter.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 14 Jan 2005 10:13:52 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by jupiter.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j0EAE2s29971 for ; Fri, 14 Jan 2005 11:14:03 +0100 (MET) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Fri, 14 Jan 2005 11:13:53 +0100 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: "'pgsql-sql@postgresql.org'" Subject: Re: Column with recycled sequence value Date: Fri, 14 Jan 2005 10:09:40 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200501/98 X-Sequence-Number: 19886 > -----Original Message----- > From: Andrew Sullivan [mailto:ajs@crankycanuck.ca] > Sent: Donnerstag, 13. J=E4nner 2005 20:49 > To: 'pgsql-sql@postgresql.org' > Subject: Re: [SQL] Column with recycled sequence value >=20 ... > > used 2^32 will be reached soon and then? There are far less=20 > than 4G-records > > saved thus these values may be reused. How can this be = accomplished? >=20 > 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. >=20 > 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