X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 41FAF474E42 for ; Wed, 5 Feb 2003 23:59:50 -0500 (EST) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.227.56]) by postgresql.org (Postfix) with ESMTP id A1042474E44 for ; Wed, 5 Feb 2003 23:59:49 -0500 (EST) Received: from roberto by brasileiro.net with local (Exim 3.35 #1 (Debian)) id 18geF9-0005M8-00; Wed, 05 Feb 2003 22:06:35 -0700 Date: Wed, 5 Feb 2003 22:06:35 -0700 From: Roberto Mello To: Rodger Donaldson Cc: Tom Lane , pgsql-sql@postgresql.org Subject: Re: to_date has beaten me... Message-ID: <20030206050635.GB19492@cc.usu.edu> References: <20030206040247.GA8032@diaspora.gen.nz> <9133.1044505377@sss.pgh.pa.us> <20030206042539.GA8420@diaspora.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20030206042539.GA8420@diaspora.gen.nz> User-Agent: Mutt/1.4i X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/107 X-Sequence-Number: 11505 On Thu, Feb 06, 2003 at 05:25:39PM +1300, Rodger Donaldson wrote: > On Wed, Feb 05, 2003 at 11:22:57PM -0500, Tom Lane wrote: > > Rodger Donaldson writes: > > > values (to_date('06/Feb/2003:11:29:11 +13', 'DD/Mon/YYYY:HH24:MI:SS'),0,302, > > > > > Always inserts the correct date, but sets the time to midnight. > > > > Um, well, yeah ... it's to_DATE, meaning it produces a result of type > > date. I think you wanted to_timestamp(). > > Why yes. Yes I did. Too much time spent with Oracle, evidently. > Next I'll be wondering why DECODE doesn't work... Because DECODE is non-standard AFAIK. You can use CASE WHEN in PostgreSQL, which IIRC, started being supported in Oracle 8.1.7. -Roberto -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + The linuX Files -- The Source is Out There. -- Sent in by Craig S. Bell, goat@aracnet.com