Re: extracting from epoch values in pgsql - Mailing list pgsql-sql

From Gavin McCullagh
Subject Re: extracting from epoch values in pgsql
Date
Msg-id 20090917173039.GV16815@gcd.ie
Whole thread Raw
In response to Re: extracting from epoch values in pgsql  (Frank Bax <fbax@sympatico.ca>)
Responses Re: extracting from epoch values in pgsql
Re: extracting from epoch values in pgsql
Re: extracting from epoch values in pgsql
List pgsql-sql
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:

moodle-01-01-2009=# select time, to_timestamp(time) AS ts, extract('month','to_timestamp(time)') from mdl_log LIMIT
10;
ERROR:  syntax error at or near ","
LINE 1: ...ct time, to_timestamp(time) AS ts, extract('month','to_times...
             ^
 
moodle-01-01-2009=# select time, to_timestamp(time) AS ts, extract('months','to_timestamp(time)') from mdl_log LIMIT
10;
ERROR:  syntax error at or near ","
LINE 1: ...t time, to_timestamp(time) AS ts, extract('months','to_times...
             ^
 
Gavin




pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: extracting from epoch values in pgsql
Next
From: Osvaldo Kussama
Date:
Subject: Re: extracting from epoch values in pgsql