Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 243AB47619D for ; Thu, 2 May 2002 06:01:57 -0400 (EDT) Received: from www1.translationforge.com (unknown [212.11.36.58]) by postgresql.org (Postfix) with ESMTP id 36A29476127 for ; Thu, 2 May 2002 05:58:55 -0400 (EDT) Received: from linus.translationforge.com ([192.168.1.102]) by www1.translationforge.com (8.12.1/8.12.1) with ESMTP id g429wuKO032244; Thu, 2 May 2002 11:58:56 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Jean-Michel POURE Reply-To: jm.poure@freesurf.fr To: postgres@vrane.com, alanjwayne@yahoo.com Subject: Re: HOWTO - Random character generation for primary key Date: Thu, 2 May 2002 11:58:53 +0200 X-Mailer: KMail [version 1.4] Cc: pgsql-general@postgresql.org References: <20020502020148.35486.qmail@web21203.mail.yahoo.com> <200205021104.06992.jm.poure@freesurf.fr> <20020502053002.A4681@amd.universe> In-Reply-To: <20020502053002.A4681@amd.universe> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200205021158.53937.jm.poure@freesurf.fr> X-Archive-Number: 200205/51 X-Sequence-Number: 24031 Le Jeudi 2 Mai 2002 11:30, postgres@vrane.com a =E9crit : > Untrue. I am using email addresses > as primary keys in a table. Where > did you get that information? Sorry, I did not mean that of course. I posted this small howto in reply to= a=20 mail. It shows how to create a VACHAR PRIMARY KEY with unique random values. On 10 character lenght, there is approximatively one chance out of 26^10 to= =20 have a similar value. If you add a string timestamp, like "20020501_1153_" = in=20 front of the random value, it is very likely that this value will be UNIQUE= =20 in the word: Examples: - 20020501_1153_AHFYRIDKRN - 20020501_1154_JDIFTPWNEJ I would like to write a small HOWTOs about : - Software optimization and performance (not pseudo-hardware / memory /=20= =20 etc..), - PLpgSQL and PLpython.=20 Therefore, I try to send small HOWTOs on the list whenever I can answer=20 someone. Any help welcome. Best regards, Jean-Michel POURE