Convert TimeStamp to Date

From: "shuai(at)objectwareinc(dot)com" <shuai(at)objectwareinc(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Convert TimeStamp to Date
Date: 2003-07-23 17:36:52
Message-ID: 17365280900058@UTIL.objectwareinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Hi all,

I am trying to convert a timestamp field to a date. ('1993-08-10
17:48:41.074' to '1993-08-10').
I used date(TIMESTAMP_FIELD), but it seemed working only for date
after year 2000 and return the previous date
for any day before year 2000. Is that a bug or I just didn't
understand the function?

I am now using to_date(TIMESTAMP_FIELD,'YYYY-MM-DD'). It works but
the performance is very poor. My query is about
2-3 times slower now.

So, what is the most efficient way to cast a timestamp field to a
date?

Thank you for your time!

LS

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Patrick Welche 2003-07-23 17:48:51 Re: Convert TimeStamp to Date
Previous Message Misha Gale 2003-07-23 08:56:40 Re: HELP! BUG? pg_dump mucks up grant/revoke

Browse pgsql-general by date

  From Date Subject
Next Message Patrick Welche 2003-07-23 17:48:51 Re: Convert TimeStamp to Date
Previous Message Nailah Ogeer 2003-07-23 17:31:03 Re: Increasing Max # of connections