Re: What Am I Doing Wrong? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: What Am I Doing Wrong?
Date
Msg-id 20051018233914.GA44288@winnie.fuhr.org
Whole thread Raw
In response to What Am I Doing Wrong?  ("Lane Van Ingen" <lvaningen@esncc.com>)
List pgsql-sql
On Tue, Oct 18, 2005 at 03:38:54PM -0400, Lane Van Ingen wrote:
> select EXTRACT(EPOCH from TIMESTAMP current_timestamp) - EXTRACT(EPOCH from
> TIMESTAMP updated_time) ::integer
> 
> ERROR:  syntax error at or near "current_timestamp" at character 37

What are you intending "TIMESTAMP" to do?  If you're trying to do
a cast then see "Type Casts" in the documentation for the correct
syntax:

http://www.postgresql.org/docs/8.0/interactive/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS

You might not need a cast at all:

test=> SELECT extract(epoch FROM current_timestamp);   date_part     
------------------1129678734.81522
(1 row)

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Michael Glaesemann
Date:
Subject: Re: Query information needed
Next
From: Judith Altamirano Figueroa
Date:
Subject: query to file