pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lane Van Ingen <lvaningen@esncc.com>
To: pgsql-sql@postgresql.org
Subject: What Am I Doing Wrong?
Date: Tue, 18 Oct 2005 15:38:54 -0400
Message-ID: <EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com> (raw)

I have been trying to subtract two timestamps from each other to determine
the difference between the two timestamps (current time and a past timestamp
called 'updated_time') IN SECONDS, but no luck.

The trouble I am having is getting the first timestamp, representing the
current time, to translate to seconds; have tried different commands (now(),
localtimestamp, current_timestamp, etc)

What am I doing wrong? Sample statement and error message is below:

                      ------------------------------------------

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





view thread (3+ messages)  latest in thread

Message-ID: <EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com>
Permalink:  ../EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com/
Also on:    postgresql.org/message-id/EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com

 · 

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: lvaningen@esncc.com
  Subject: Re: What Am I Doing Wrong?
  In-Reply-To: <EKEMKEFLOMKDDLIALABIIEPMCDAA.lvaningen@esncc.com>

* 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