Received: from mail-b.bcc.ac.uk (mail-b.bcc.ac.uk [144.82.100.22]) by hub.org (8.8.8/8.7.5) with ESMTP id IAA06538 for ; Mon, 6 Jul 1998 08:45:43 -0400 (EDT) Received: from kestrel.ludwig.ucl.ac.uk by mail-b.bcc.ac.uk with SMTP (XT-PP); Mon, 6 Jul 1998 13:45:15 +0100 Received: from by kestrel.ludwig.ucl.ac.uk (4.1/SMI-4.1) id AB13516; Mon, 6 Jul 1998 13:49:14 BST X-Sender: stuart@kestrel.ludwig.ucl.ac.uk Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 6 Jul 1998 13:41:56 +0100 To: pgsql-sql@postgresql.org From: Stuart Rison Subject: Primary keys: can they be alphanumerical? Dear All, I'm using postgreSQL to create a database of breast cancer patient data. I am currently designing my tables. I would like to know what is the general concensus on having alphanumerical primary keys. The reason for this is that, with a 15 character long alphanumerical key, I could include hidden information in the key which could help users to quickly get information without even having to search the database. For example, the first to characters could be a two-letter code for the refering hospital, the next four a numerical patient number and subsequent characters refer to treating clinicians etc. Is this a major 'faux-pas'? Am I introducing unwanted redundancy in the key? Will it make indexing a lot slower? Should primary keys be purely numerical? I would be grateful for any comments/suggestions. Best regards, Stuart. PS. could you cc me a copy of your posting(s). +-------------------------+--------------------------------------+ | Stuart Rison | Ludwig Institute for Cancer Research | | Tel. (0171) 878 4041 | Courtauld Building | | Fax. (0171) 878 4040 | 91 Riding House Street | +-------------------------+ London, W1P 8BT | | stuart@ludwig.ucl.ac.uk | UNITED KINGDOM. | +-------------------------+--------------------------------------+