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: "Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] how to create index on timestamp field in pre v7 database
Date: 2000-02-25 16:29:16
Message-ID: 7601.951496156@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

"Moray McConnachie" <moray(dot)mcconnachie(at)computing-services(dot)oxford(dot)ac(dot)uk> writes:
> Agreed - but note that pg_dump currently produces CREATE INDEX
> statements with opclasses included.

Right, as it should since its purpose is to ensure you rebuild exactly
the same database. I was just opining that handwritten CREATE INDEXes
usually can omit the opclass. (BTW, I fixed the problem with functional
indexes needing an explicit opclass spec last night.)

> That means running a script created by pg_dump v.6.5.x will fail under
> 7.0 because there is no index opclass of the type datetime?

An embarrassing problem. We are going to work around this by having
the 7.0 parser discard the word "datetime" if it sees it in the opclass
position. There are a couple of other now-dead opclass names that will
be discarded in the same way. Klugy, but it will get the job done for
reading old dump files.

(This hack is not in 7.0beta1, but will be in beta2.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-02-25 16:36:23 Re: missing function datetime()
Previous Message Joaquin Eduardo Monje 2000-02-25 14:03:37 subscribe

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-02-25 16:36:23 Re: missing function datetime()
Previous Message Jan Wieck 2000-02-25 16:11:35 Re: [SQL] Finding missing records...