Skip site navigation (1) Skip section navigation (2)

how to create index on timestamp field in pre v7 database

From: Alex Howansky <alex(at)wankwood(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: how to create index on timestamp field in pre v7 database
Date: 2000-02-24 22:27:21
Message-ID: Pine.LNX.4.21.0002241604480.17558-100000@net-srv-0001.bvrd.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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/


Responses

pgsql-hackers by date

Next:From: Hannu KrosingDate: 2000-02-24 22:37:30
Subject: Re: AW: AW: AW: .... (off-topic)
Previous:From: Roberto CornacchiaDate: 2000-02-24 21:41:25
Subject: Re: about 7.0 LIMIT optimization

pgsql-sql by date

Next:From: M.MazurekDate: 2000-02-24 22:38:48
Subject: date_part, too many results?
Previous:From: Tom LaneDate: 2000-02-24 22:14:03
Subject: Re: [SQL] cache lookup failed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group