Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5C38D2E0095 for ; Wed, 30 Jan 2008 20:26:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 40788-02 for ; Wed, 30 Jan 2008 20:26:05 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id C34F72E00B3 for ; Wed, 30 Jan 2008 20:26:11 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m0V0QAqT027258; Wed, 30 Jan 2008 19:26:10 -0500 (EST) To: Luca Clementi cc: pgsql-sql@postgresql.org Subject: Re: Problem with the to_timestamp function In-reply-to: <47A10A1D.5020408@ucsd.edu> References: <47A10A1D.5020408@ucsd.edu> Comments: In-reply-to Luca Clementi message dated "Wed, 30 Jan 2008 15:37:01 -0800" Date: Wed, 30 Jan 2008 19:26:10 -0500 Message-ID: <27257.1201739170@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/233 X-Sequence-Number: 30086 Luca Clementi writes: > It seems that the to_timestamp does not work properly in this case, > when it comes to parsing the hours. to_timestamp() is not very robust if the input doesn't exactly match what it expects for the format string. I'm not sure if that's the issue here, but have you tried just casting the string to timestamp? That would use the standard timestamp input converter, which is pretty flexible. (BTW, there is definitely 0 hope of recognizing a timezone name that's written in Chinese characters, unless maybe you fool around with the timezone-abbreviations configuration file.) regards, tom lane