Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id ADF4F476C86 for ; Wed, 19 Jun 2002 17:21:42 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 41DE4475CC7 for ; Wed, 19 Jun 2002 17:19:37 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5JLJV107416; Wed, 19 Jun 2002 17:19:31 -0400 (EDT) To: Steve Wampler Cc: postgres-sql Subject: Re: Tagging rows into collections? In-reply-to: <3D10AAFB.D51B1B66@noao.edu> References: <3D10AAFB.D51B1B66@noao.edu> Comments: In-reply-to Steve Wampler message dated "Wed, 19 Jun 2002 09:02:03 -0700" Date: Wed, 19 Jun 2002 17:19:31 -0400 Message-ID: <7413.1024521571@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/259 X-Sequence-Number: 8224 Steve Wampler writes: > An event has: timestamp,event_name,list_of_attributes > The list_of_attributes are simple (string) name,value pairs. > However, although selection performance isn't a priority, the > ability to reconstruct the events from the database is needed > and the above simple table doesn't provide enough information > to do so. (The resolution on the timestamp field isn't > enough to distinquish separate events that have the same name.) What PG version are you using? In 7.2 the default timestamp resolution is microseconds, rather than seconds. That might be enough to fix your problem. If not, your two-table approach sounds reasonable. You could stick with one table and use arrays for the name/value columns, but that will make searches harder. regards, tom lane