Received: from fslc.ser.usu.edu (fslc.ser.usu.edu [129.123.28.122]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3GGVsu33471 for ; Mon, 16 Apr 2001 12:31:54 -0400 (EDT) (envelope-from rmello@fslc.usu.edu) Received: (from rmello@localhost) by fslc.ser.usu.edu (8.12.0.Beta5/8.12.0.Beta5/Debian 8.12.0-1) id f3GGVnIE017653; Mon, 16 Apr 2001 10:31:49 -0600 Date: Mon, 16 Apr 2001 10:31:49 -0600 From: Roberto Mello To: Bernardo de Barros Franco Cc: pgsql-sql@postgresql.org Subject: Re: Using Random Sequence as Key Message-ID: <20010416103149.A17607@cc.usu.edu> References: <9bdjag$faj$1@news.tht.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i In-Reply-To: <9bdjag$faj$1@news.tht.net>; from electric_csf@hotmail.com on Sun, Apr 15, 2001 at 10:58:40PM -0300 X-Archive-Number: 200104/253 X-Sequence-Number: 2603 On Sun, Apr 15, 2001 at 10:58:40PM -0300, Bernardo de Barros Franco wrote: > I wanted to index a table by a random key. Exemplifying, when a insert is > made, the id value is automatically filled with a random number between > 10000 and 99999. I'm pretty new in pgsql so I could use a howto or Bernardo, Do you really need the keys to be random numbers? Can't the keys be sequential numbers, like 1,2,3,4...? That'd be a lot easier to make unique, and as far as the user is concerned, it'll be random for him/her. -Roberto -- +----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU - http://www.brasileiro.net http://www.sdl.usu.edu - Space Dynamics Lab, Developer Oh my GOSH! A Prompt!!! HELP!!!! A PROMPT !!!!! HEEEEELP !!!!!!!!!!!!!