Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E80842E01A0 for ; Tue, 18 Mar 2008 14:56:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10105-05 for ; Tue, 18 Mar 2008 14:56:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from yertle.kcilink.com (thingy.kcilink.com [74.92.149.59]) by postgresql.org (Postfix) with ESMTP id A55492E01A1 for ; Tue, 18 Mar 2008 14:56:39 -0300 (ADT) Received: from host-121.int.kcilink.com (host-121.int.kcilink.com [192.168.7.121]) by yertle.kcilink.com (Postfix) with ESMTP id 098238A03A for ; Tue, 18 Mar 2008 13:56:38 -0400 (EDT) Message-Id: <6649C6F5-BEDE-4A66-A9A3-33CE95633A83@khera.org> From: Vivek Khera To: pgsql-sql@postgresql.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: Create on insert a unique random number Date: Tue, 18 Mar 2008 13:56:37 -0400 References: <268179.51357.qm@web54301.mail.re2.yahoo.com> <20080318165138.GA6578@a-kretschmer.de> X-Mailer: Apple Mail (2.919.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/106 X-Sequence-Number: 30434 On Mar 18, 2008, at 1:03 PM, Campbell, Lance wrote: > The field n is not random but is sequential. Is there something I > should do to make the serial number random? Depending on your "randomness" need, you can alter the increment of the sequence so it changes by a different amount than "1" on every increment, though it will still be constant increment. You need to specify what the purpose of it being random is, then you might get more useful responses. Does it need to be random for some security purpose? If so, describe the level of security, specifically, against what threat are you defending?