Re: to_date has beaten me...

From: Roberto Mello <rmello(at)cc(dot)usu(dot)edu>
To: Rodger Donaldson <rodgerd(at)diaspora(dot)gen(dot)nz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org
Subject: Re: to_date has beaten me...
Date: 2003-02-06 05:06:35
Message-ID: 20030206050635.GB19492@cc.usu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 <rodgerd(at)diaspora(dot)gen(dot)nz> 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(at)aracnet(dot)com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rodger Donaldson 2003-02-06 09:19:03 Re: to_date has beaten me...
Previous Message Rodger Donaldson 2003-02-06 04:25:39 Re: to_date has beaten me...