Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 560D96353FE for ; Thu, 17 Sep 2009 14:02:06 -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 26061-09 for ; Thu, 17 Sep 2009 17:01:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from tomts43-srv.bellnexxia.net (tomts43.bellnexxia.net [209.226.175.110]) by mail.postgresql.org (Postfix) with ESMTP id 90B2063527C for ; Thu, 17 Sep 2009 14:01:58 -0300 (ADT) Received: from toip3.srvr.bell.ca ([209.226.175.86]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20090917170157.WZGL14846.tomts43-srv.bellnexxia.net@toip3.srvr.bell.ca> for ; Thu, 17 Sep 2009 13:01:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnwJAMMGskpA53n0/2dsb2JhbACBU5IQNMw5hBwF 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 12:53:12 -0400 Message-ID: <4AB26B6F.4010207@sympatico.ca> Date: Thu, 17 Sep 2009 13:01:35 -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> In-Reply-To: <20090917164439.GU16815@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/83 X-Sequence-Number: 33148 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)