Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 227BF475AE8 for ; Thu, 20 Jun 2002 09:54:23 -0400 (EDT) Received: from noao.edu (dns.noao.edu [140.252.1.54]) by postgresql.org (Postfix) with ESMTP id 6C4804766D5 for ; Thu, 20 Jun 2002 09:34:48 -0400 (EDT) Received: from weaver.tuc.noao.edu ([140.252.38.8] verified) by noao.edu (CommuniGate Pro SMTP 3.5.6) with ESMTP id 4523538; Thu, 20 Jun 2002 06:34:50 -0700 Received: from noao.edu (localhost [127.0.0.1]) by weaver.tuc.noao.edu (8.11.6/8.11.6) with ESMTP id g5KDYof02133; Thu, 20 Jun 2002 06:34:50 -0700 Message-ID: <3D11D9FA.F630297D@noao.edu> Date: Thu, 20 Jun 2002 06:34:50 -0700 From: Steve Wampler Organization: National Solar Observatory X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.9-31smp i686) X-Accept-Language: en MIME-Version: 1.0 To: postgres-sql Subject: Re: Tagging rows into collections? References: <3D10AAFB.D51B1B66@noao.edu> <7413.1024521571@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/273 X-Sequence-Number: 8238 Tom Lane wrote: > > 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. Still 7.1. I'd rather not rely on the timestamp resolution, though that would probably work with 7.2's resolution. > 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. I'll try the two-table approach - thanks! How can I associate entries in the first table with entries in the second? Would using the OID work - and, if so, how? (Since insertion performance is important, I'd like to avoid having to do an: [insert ; query-to-get-id;insert sequences]. Is there a way in SQL to set up the linkage between a row in the first table and (multiple) rows in the second table? Thanks! -- Steve Wampler -- swampler@noao.edu The gods that smiled on your birth are now laughing out loud.