pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Lane Van Ingen <lvaningen@esncc.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: What Am I Doing Wrong?
Date: Tue, 18 Oct 2005 17:39:15 -0600
Message-ID: <20051018233914.GA44288@winnie.fuhr.org> (raw)
In-Reply-To: <EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com>
References: <EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com>

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



view thread (3+ messages)

Message-ID: <20051018233914.GA44288@winnie.fuhr.org>
Permalink:  ../20051018233914.GA44288@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051018233914.GA44288@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, lvaningen@esncc.com
  Subject: Re: What Am I Doing Wrong?
  In-Reply-To: <20051018233914.GA44288@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox