X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 036B153DC0 for ; Fri, 22 Apr 2005 05:43:12 -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 54145-02 for ; Fri, 22 Apr 2005 08:43:09 +0000 (GMT) Received: from nordine.ateur (main.librelogiciel.com [62.212.108.58]) by svr1.postgresql.org (Postfix) with ESMTP id 89F8953DA4 for ; Fri, 22 Apr 2005 05:43:05 -0300 (ADT) Received: from jerome by nordine.ateur with local (Exim 3.36 #1 (Debian)) id 1DOtkb-0003XE-00 for ; Fri, 22 Apr 2005 10:43:01 +0200 Date: Fri, 22 Apr 2005 10:43:01 +0200 To: pgsql-sql@postgresql.org Subject: string to date conversion Message-ID: <20050422084301.GB12176@mail.librelogiciel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i From: Jerome Alet X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/320 X-Sequence-Number: 21213 Hi, I'm working on an existing Pg database which, please don't ask why, stores dates as varchar attributes in the form 'YYYY/MM/DD' I'm not allowed to modify the tables to use 'timestamp' instead, so I'd like to convert on the fly when retrieving datas with select. When I do : select mydatefield::timestamp from mytable; There's an error saying that converting from varchar to date is not possible How can I do this ? Thanks in advance Jerome Alet