Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3CEA3B5DBDA for ; Wed, 12 Oct 2011 11:07:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 01837-04 for ; Wed, 12 Oct 2011 14:07:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id B31E3B5DBD6 for ; Wed, 12 Oct 2011 11:07:06 -0300 (ADT) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p9CE7503093701; Wed, 12 Oct 2011 17:07:05 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p9CE75gp093700; Wed, 12 Oct 2011 17:07:05 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: gnanam@zoniac.com, pgsql-admin@postgresql.org Subject: Re: How to find and/or REINDEX only GiST indexes in the database? Date: Wed, 12 Oct 2011 17:07:05 +0300 User-Agent: KMail/1.9.7 References: <008201cc88dd$0208c1a0$061a44e0$@com> In-Reply-To: <008201cc88dd$0208c1a0$061a44e0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201110121707.05850.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.279 tagged_above=-10 required=5 tests=BAYES_00=-1.9, KHOP_DYNAMIC=0.73, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201110/58 X-Sequence-Number: 38510 =CE=A3=CF=84=CE=B9=CF=82 Wednesday 12 October 2011 15:46:45 =CE=BF/=CE=B7 G= nanakumar =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > Hi, >=20 > We're planning to upgrade our Production server from PostgreSQL v8.2.3 to > the latest version in 8.2 series, that is v8.2.22. =20 >=20 > In 8.2.11 Release Notes here > http://www.postgresql.org/docs/current/interactive/release-8-2-11.html, i= t's > been mentioned that: > "Also, if you were running a previous 8.2.X release, it is recommended to > REINDEX all GiST indexes after the upgrade." >=20 > My question is, how do I find out or REINDEX *only* GiST indexes in the > database? Is there a single syntax/command that does this? I guess not, one way is to take an ascii schema-only dump and parse it, looking for GIST indexes. Anotherway is to look in those tables: SELECT oid,* from pg_opclass ; -- to find the GIST class SELECT c.relname,indclass from pg_catalog.pg_index i,pg_catalog.pg_class c = where indexrelid=3Dc.oid; ^^ to find those indexes which have this gist class oid in the indclass fie= ld. Note tho, that indclass is oidvector, and i dont know how you could iterate= on those (by SQL),=20 without writing a C (or other) program. >=20 > Regards, > Gnanam >=20 >=20 >=20 =2D-=20 Achilleas Mantzios