Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 27491476CEB for ; Wed, 11 Dec 2002 15:09:13 -0500 (EST) Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (Postfix) with ESMTP id D34A3476CD7 for ; Wed, 11 Dec 2002 15:07:16 -0500 (EST) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.12.6/8.12.6/Debian-6Woody) with SMTP id gBBK7Hpq007356; Wed, 11 Dec 2002 15:07:17 -0500 Reply-To: From: "Nick Fankhauser" To: "Jodi Kanter" , "Postgres Admin List" Subject: Re: PKs for dictionary tables Date: Wed, 11 Dec 2002 15:03:19 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <010301c2a14e$af1f4ba0$de138f80@virginia.edu> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/158 X-Sequence-Number: 6653 The preferred method is to have a PK and store it in your big table. In addition to being more "normal" and probably saving a little space, this gives you the option of changing the corresponding values in one place. So for instance if your lookup table was "datatypes", and you had entered "Sting" at first, after several thousand records had been created that referred to this in the main table, you would be able to correct your spelling for all of them by changing a single field in the lookup table... -Nick -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Jodi Kanter Sent: Wednesday, December 11, 2002 2:51 PM To: Postgres Admin List Subject: [ADMIN] PKs for dictionary tables I have a database in which there is a particular data tables that has a lot of dictionary (or lookup) tables hanging off of it. The dictionary tables do not currently have PKs. They consist merely of a list of values that are used to create drop down lists in an application. Would it be more efficient to create PKs for these dictionary tables so that an integer value is stored in the main data table as opposed to a sting value? Is there a preferred database standard? Thanks Jodi _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu