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: "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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-sql by date

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

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