Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id EEF7A63338F for ; Tue, 20 Oct 2009 17:30:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 01702-02 for ; Tue, 20 Oct 2009 20:30:18 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out13.alice.it (smtp-out13.alice.it [85.33.2.18]) by mail.postgresql.org (Postfix) with ESMTP id B02766324FC for ; Tue, 20 Oct 2009 17:30:18 -0300 (ADT) Received: from FBCMMO03.fbc.local ([192.168.68.197]) by smtp-out13.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Oct 2009 22:30:16 +0200 Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by FBCMMO03.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Oct 2009 22:30:16 +0200 Received: from lan.webthatworks.it ([80.116.95.48]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Oct 2009 22:30:15 +0200 Received: from dawn.webthatworks.it (dawn.webthatworks.it [192.168.1.12]) by lan.webthatworks.it (Postfix) with ESMTP id E1F7A300346 for ; Tue, 20 Oct 2009 22:30:15 +0200 (CEST) Received: from dawn.webthatworks.it (localhost [127.0.0.1]) by dawn.webthatworks.it (Postfix) with ESMTP id A02A33DA9B for ; Tue, 20 Oct 2009 22:30:13 +0200 (CEST) Date: Tue, 20 Oct 2009 22:30:13 +0200 From: Ivan Sergio Borgonovo To: pgsql-sql@postgresql.org Subject: Re: Random Unique Id Message-ID: <20091020223013.45efebef@dawn.webthatworks.it> In-Reply-To: <80df75370910201249k40e308dbh668872e0e2ed2419@mail.gmail.com> References: <80df75370910201249k40e308dbh668872e0e2ed2419@mail.gmail.com> Organization: http://www.webthatworks.it X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Oct 2009 20:30:15.0206 (UTC) FILETIME=[2190D460:01CA51C4] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.185 tagged_above=-10 required=5 tests=BAYES_40=-0.185 X-Spam-Level: X-Archive-Number: 200910/83 X-Sequence-Number: 33282 On Tue, 20 Oct 2009 16:49:17 -0300 Nahuel Alejandro Ramos wrote: > Hi all, > I was searching for a sequence (for serials) that let me use a > random unique number ID on a Primary Key or a simple index. > I have not found a solution so I have done it by myself. I would > like to share it so here it is: http://www.webthatworks.it/d1/node/page/pseudo_random_sequences_postgresql Adapted from Daniel Verite suggestion. -- Ivan Sergio Borgonovo http://www.webthatworks.it