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 C641ED86A6 for ; Tue, 13 Sep 2005 01:53:15 -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 40917-02 for ; Tue, 13 Sep 2005 04:53:13 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id D0A8AD862B for ; Tue, 13 Sep 2005 01:53:13 -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 j8D4r8BQ043818 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Sep 2005 22:53:10 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j8D4r8ET098301; Mon, 12 Sep 2005 22:53:08 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j8D4r7Dw098300; Mon, 12 Sep 2005 22:53:07 -0600 (MDT) (envelope-from mfuhr) Date: Mon, 12 Sep 2005 22:53:07 -0600 From: Michael Fuhr To: Wei Cc: pgsql-sql@postgresql.org Subject: Re: How do I convert an integet to a timestamp? Message-ID: <20050913045307.GA98267@winnie.fuhr.org> References: <1126548068.702382.67260@z14g2000cwz.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1126548068.702382.67260@z14g2000cwz.googlegroups.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 required=5 tests=[AWL=0.005] X-Spam-Level: X-Archive-Number: 200509/143 X-Sequence-Number: 22690 On Mon, Sep 12, 2005 at 11:01:08AM -0700, Wei wrote: > I followed the doc and tried "select CAST(1126547334 AS timestamp)" and > I only got an error response that says: ERROR: cannot cast type > integer to timestamp without time zone. What documentation suggested casting an integer to a timestamp? > What is the proper way to do the conversion? See "Date/Time Functions and Operators" -- it has an example of what you're trying to do: http://www.postgresql.org/docs/8.0/interactive/functions-datetime.html -- Michael Fuhr