how to create index on timestamp field in pre v7 database - Mailing list pgsql-sql

From Alex Howansky
Subject how to create index on timestamp field in pre v7 database
Date
Msg-id Pine.LNX.4.21.0002241604480.17558-100000@net-srv-0001.bvrd.com
Whole thread Raw
Responses Re: [SQL] how to create index on timestamp field in pre v7 database  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
This page:

http://www.postgresql.org/docs/postgres/datatype1033.htm

says to use timestamp in preference to datetime. It also says that datetime is
"equivalent to timestamp". Ok, so I'll use timestamp, no prob. But I want to
index that field. In v6.5.3, there is no timestamp_ops, only datetime_ops. In
v7.0b1 the datetime_ops is gone, and there is a timestamp_ops available, which
takes care of my problem. But until I put 7.0 on my production server, I can't
make an index on a timestamp field. My question is, how "equivalent" are these
types? Can I use datetime_ops to index a timestamp field in a v6.5.3 database?
I.e., can I do this:

create table thing ( bleh text, blah timetamp );
create index thing_blah on thing ( blah datetime_ops );

It runs without error, but is it legit? TIA...

-- 
Alex Howansky
Wankwood Associates
http://www.wankwood.com/



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] cache lookup failed
Next
From: Tom Lane
Date:
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database