Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 00656633C9C for ; Thu, 17 Sep 2009 14:38:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 30251-09 for ; Thu, 17 Sep 2009 17:38:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from tomts40-srv.bellnexxia.net (tomts40.bellnexxia.net [209.226.175.97]) by mail.postgresql.org (Postfix) with ESMTP id 4D28563373B for ; Thu, 17 Sep 2009 14:38:36 -0300 (ADT) Received: from toip3.srvr.bell.ca ([209.226.175.86]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20090917173834.LVYG14748.tomts40-srv.bellnexxia.net@toip3.srvr.bell.ca> for ; Thu, 17 Sep 2009 13:38:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkYJAG8PskpA53n0/2dsb2JhbACBU5JEzDqEHAU Received: from bas4-london14-1088911860.dsl.bell.ca (HELO t60p.bax.ca) ([64.231.121.244]) by toip3.srvr.bell.ca with ESMTP; 17 Sep 2009 13:30:11 -0400 Message-ID: <4AB2741A.2050409@sympatico.ca> Date: Thu, 17 Sep 2009 13:38:34 -0400 From: Frank Bax User-Agent: Thunderbird 2.0.0.19 (X11/20090301) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: extracting from epoch values in pgsql References: <20090917164439.GU16815@gcd.ie> <4AB26B6F.4010207@sympatico.ca> <20090917173039.GV16815@gcd.ie> In-Reply-To: <20090917173039.GV16815@gcd.ie> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200909/88 X-Sequence-Number: 33153 Gavin McCullagh wrote: > On Thu, 17 Sep 2009, Frank Bax wrote: > >> Gavin McCullagh wrote: >>> SELECT time, to_timestamp(time) AS ts, >>> EXTRACT('months',to_timestamp(time)) FROM mdl_log; >>> ERROR: syntax error at or near "," >>> LINE 1: ...t time, to_timestamp(time) AS ts, extract('months',to_times... >> Try replacing extract('month',value) with extract('months' from value) > > Makes no difference whether month or months: Sorry; my typo. You used a comma in "extract" instead of "from".