Convert TimeStamp to Date - Mailing list pgsql-general

From shuai@objectwareinc.com
Subject Convert TimeStamp to Date
Date
Msg-id 17365280900058@UTIL.objectwareinc.com
Whole thread Raw
Responses Re: Convert TimeStamp to Date  (Patrick Welche <prlw1@newn.cam.ac.uk>)
List 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

pgsql-general by date:

Previous
From: Nailah Ogeer
Date:
Subject: Re: Increasing Max # of connections
Next
From: Patrick Welche
Date:
Subject: Re: Convert TimeStamp to Date