X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CD6D6D9C37 for ; Tue, 18 Oct 2005 20:39:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66087-07 for ; Tue, 18 Oct 2005 23:39:39 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id B2D4CD9BDC for ; Tue, 18 Oct 2005 20:39:40 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9INdFFL093571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Oct 2005 17:39:17 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id j9INdFDQ044343; Tue, 18 Oct 2005 17:39:15 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id j9INdFRL044342; Tue, 18 Oct 2005 17:39:15 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 18 Oct 2005 17:39:15 -0600 From: Michael Fuhr To: Lane Van Ingen Cc: pgsql-sql@postgresql.org Subject: Re: What Am I Doing Wrong? Message-ID: <20051018233914.GA44288@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/201 X-Sequence-Number: 23054 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