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

Re: [SQL] how to create index on timestamp field in pre v7 database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alex Howansky <alex(at)wankwood(dot)com>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database
Date: 2000-02-24 23:57:50
Message-ID: 23337.951436670@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-sql
Alex Howansky <alex(at)wankwood(dot)com> writes:
> My question is, how "equivalent" are these types?

They're the same code: we jacked up the name "timestamp" and rolled the
old datetime code underneath.  Strictly a matter of coming closer to
the SQL standard names for these datatypes.

> Can I use datetime_ops to index a timestamp field in a v6.5.3 database?

Similarly, "datetime_ops" in 6.5 is now "timestamp_ops".

As a rule, I'd suggest not bothering with opclasses in index
declarations.  The only situation where you need to select one is
where there is more than one possible opclass for the same datatype.
This holds for some of the geometric types, but not for any plain scalar
types like numerics or date/time types.  (You could think of an opclass
as specifying which sort order the index uses...)

			regards, tom lane

PS: Actually there's a second case where you must specify an opclass,
which is if you are creating a functional index; for some reason the
system can't figure out the right opclass in that case.  This is a bug,
no doubt ... never looked at it hard enough to see why it's failing.

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-02-25 00:17:36
Subject: Re: [HACKERS] Re: [PATCHES] Patch for more readable parse error messages
Previous:From: Bruce MomjianDate: 2000-02-24 23:50:24
Subject: Re: [HACKERS] Re: [PATCHES] Patch for more readable parse error messages

pgsql-sql by date

Next:From: Tom LaneDate: 2000-02-25 00:46:20
Subject: Re: [SQL] date_part, too many results?
Previous:From: Tim KaneDate: 2000-02-24 23:54:18
Subject: arrays of varchar and "

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