Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3550F2E003E for ; Wed, 19 Mar 2008 06:59:50 -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 73622-08 for ; Wed, 19 Mar 2008 06:59:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 3AB162E0038 for ; Wed, 19 Mar 2008 06:59:47 -0300 (ADT) Received: from depesz by depesz.com with local (Exim 4.63) (envelope-from ) id 1Jbv5B-00042H-8t; Wed, 19 Mar 2008 10:59:41 +0100 Date: Wed, 19 Mar 2008 10:59:41 +0100 From: hubert depesz lubaczewski To: "Campbell, Lance" Cc: Vivek Khera , pgsql-sql@postgresql.org Subject: Re: Create on insert a unique random number Message-ID: <20080319095941.GB14712@depesz.com> Reply-To: depesz@depesz.com References: <268179.51357.qm@web54301.mail.re2.yahoo.com> <20080318165138.GA6578@a-kretschmer.de> <6649C6F5-BEDE-4A66-A9A3-33CE95633A83@khera.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/119 X-Sequence-Number: 30447 On Tue, Mar 18, 2008 at 01:40:42PM -0500, Campbell, Lance wrote: > This is not a security approach. It is more about not giving obvious > access to people that want to mess around. 1. keep primary key using standard serial. it will make your life a bit simpler. 2. add column for text random identifiers (it doesn't have to be number, and adding characters makes for much better "randomness"). 3. check this: http://www.depesz.com/index.php/2007/06/25/random-text-record-identifiers/ depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)