X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D6F6652BDE for ; Sat, 20 Aug 2005 01:59:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 99637-09 for ; Sat, 20 Aug 2005 04:59:22 +0000 (GMT) Received: from web52914.mail.yahoo.com (web52914.mail.yahoo.com [206.190.49.24]) by svr1.postgresql.org (Postfix) with SMTP id 63B4A52BAD for ; Sat, 20 Aug 2005 01:59:21 -0300 (ADT) Received: (qmail 40398 invoked by uid 60001); 20 Aug 2005 04:59:21 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=GdbOCKLiAglXYq2+b3K9qimqQ8u8IgL42ct8mdzrYE+P6MuDD9Jplng1MG1AjTqlr2KOJyu6J0p23dlxDArjZis/BR2oesheeK7fYE7hHS4Az8XKDTyEC8A7+KJH4ZXrXtNyVU5Fk/BS1Ud5zig6Mf5cMQoJA9hl2w3P3MDw2Cs= ; Message-ID: <20050820045921.40396.qmail@web52914.mail.yahoo.com> Received: from [67.177.211.243] by web52914.mail.yahoo.com via HTTP; Fri, 19 Aug 2005 21:59:21 PDT Date: Fri, 19 Aug 2005 21:59:21 -0700 (PDT) From: CSN Subject: Suggestion for Date/Time Functions Section To: pgsql-docs@postgresql.org, pgsql-general@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.113 required=5 tests=[AWL=-0.138, DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516, FROM_HAS_ULINE_NUMS=0.361] X-Spam-Level: * X-Archive-Number: 200508/15 X-Sequence-Number: 3177 Hi, I suggestion for the date/time functions in the docs: http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html I was trying to figure out how to do: update table set next=now() + interval 'table.period seconds'; I tried subqueries, the concat operator, and anything else I could think of until I rediscovered the page on the various ways to cast. Perhaps mix up the examples in the docs so other ways to do date arithmetic (and that allow expressions, fields, etc.) are obvious: date '2001-09-28' + cast((7+7)||' seconds' as interval); date '2001-09-28' + ((7+7)||' seconds')::interval); etc. Or am I missing an easier way to do date arithmetic using a table's fields as part of the equation? (I think mysql has date_add(...), date_subtract(...), etc. CSN __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com