From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Howansky <alex@wankwood.com>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database
Date: Thu, 24 Feb 2000 18:57:50 -0500
Message-ID: <23337.951436670@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.21.0002241604480.17558-100000@net-srv-0001.bvrd.com>
References: <Pine.LNX.4.21.0002241604480.17558-100000@net-srv-0001.bvrd.com>
Alex Howansky <alex@wankwood.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, alex@wankwood.com
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database
In-Reply-To: <23337.951436670@sss.pgh.pa.us>
References: <Pine.LNX.4.21.0002241604480.17558-100000@net-srv-0001.bvrd.com> <23337.951436670@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox