On Sep 22, 2011, at 17:13, David Johnston wrote:
> Is there some other way to create an index on only the "date" portion of the
> field?
The cast from timestamptz to date is time zone dependent, which is why it's
volatile and can't be used indexes. However, you can do this:
test=# create table
Tom Lane wrote:
>> I have a database field that stores a timestamp to second+ precision;
>> however, I want to search against it only to day precision. If I leave the
>> field in second precision and try to "WHERE field BETWEEN date0 AND date0" I
>> get no results (OK, fine) but then I cast the
"David Johnston" writes:
> I have a database field that stores a timestamp to second+ precision;
> however, I want to search against it only to day precision. If I leave the
> field in second precision and try to "WHERE field BETWEEN date0 AND date0" I
> get no results (OK, fine) but then I cast
"David Johnston" wrote:
> I have a database field that stores a timestamp to second+ precision;
> however, I want to search against it only to day precision. If I leave the
> field in second precision and try to "WHERE field BETWEEN date0 AND date0" I
> get no results (OK, fine) but then I cast
On Sep 22, 2011, at 2:13 PM, David Johnston wrote:
> Hey,
>
> On 9.0.4
>
> I have a database field that stores a timestamp to second+ precision;
> however, I want to search against it only to day precision. If I leave the
> field in second precision and try to “WHERE field BETWEEN date0 AND
Hey,
On 9.0.4
I have a database field that stores a timestamp to second+ precision;
however, I want to search against it only to day precision. If I leave the
field in second precision and try to "WHERE field BETWEEN date0 AND date0" I
get no results (OK, fine) but then I cast the field to