Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 326732E2E62 for ; Wed, 12 Dec 2007 14:00:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 10991-09 for ; Wed, 12 Dec 2007 14:00:51 -0400 (AST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by postgresql.org (Postfix) with ESMTP id EAE252E015D for ; Wed, 12 Dec 2007 14:00:51 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id j3so660425ugf.49 for ; Wed, 12 Dec 2007 10:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/aXLOwCVgFk6rHwSV0s/lgpsFTLY2b82FNzNv++i7ko=; b=eWrMFnUVsk/62l6VpIKYcJ/9ekSTk8o5kaX0Ro5cCQOOrR/ZwGVKBdcIwS/D4Ss1XkhFrEpT38ob4Yf+pVqn1OOst/CEzYXJl2+BvFcYbwG/exW1BeMiW1vKC/Z/vF+pMf6TKAKZX53HiqFI5il7krufMfahp/ikNOz8xvjbTbg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HCF6XtvKtgJqe+wHvoBdYQuww0Jqnxkjdn8xDL4oeyadTlmmfN3tuOW7qg4wzXoMCkfCwp3Bqv3OXT61NpMnBmYdwMZcnpJEH7mJOVGlmWdH9dyWWnk5NaLeH58xdInL5k46L2KxO23+YcmN2qNTIVBHkVC9mZFt/Oxco14iwls= Received: by 10.86.82.16 with SMTP id f16mr882368fgb.60.1197482450693; Wed, 12 Dec 2007 10:00:50 -0800 (PST) Received: by 10.86.51.13 with HTTP; Wed, 12 Dec 2007 10:00:50 -0800 (PST) Message-ID: <302670f20712121000w6d3c1ecg39620cfa8c39c606@mail.gmail.com> Date: Wed, 12 Dec 2007 13:00:50 -0500 From: "Gary Chambers" Subject: Re: Query Assistance Cc: pgsql-sql@postgresql.org In-Reply-To: <20071212123129.ad22c7ce.darcy@druid.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <302670f20712120858k210dd812l8b232ce98d5d162f@mail.gmail.com> <20071212123129.ad22c7ce.darcy@druid.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.182 tagged_above=0 required=5 tests=BAYES_05=-1.11, MISSING_HEADERS=1.292 X-Spam-Level: X-Archive-Number: 200712/72 X-Sequence-Number: 29764 D'Arcy... > Have you considered this? I considered integrating the begin and end times into the table. I'm capturing the data via ACPI events, so it's "transactional" by nature. I want to be able to keep track of false transitions (hence the is_outage field). I'm looking for a way to simplify the transitions output on my web browser, and I want to combine an offline and a corresponding online time into a single line. > I am also thinking of a scheme that uses two tables but I don't really > know your environment or requirements. I am assuming that you spend > more time querying the table than updating it. If not your problem > isn't your database, it's your power plant. :-) It's nothing complex at all. The power in my neighborhood is infamously unstable, and I'm merely keep records to complain as much as I can to the power company. Thanks for taking the time to reply! -- Gary Chambers // Nothing fancy and nothing Microsoft!