X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 53618D1B523 for ; Fri, 3 Oct 2003 13:21:17 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 49021-02 for ; Fri, 3 Oct 2003 10:20:34 -0300 (ADT) Received: from abe.micropat.com (abe.micropat.com [204.17.221.119]) by svr1.postgresql.org (Postfix) with ESMTP id A80EED1B531 for ; Fri, 3 Oct 2003 10:20:29 -0300 (ADT) Received: from micropat.com ([127.0.0.1]) by abe.micropat.com (Netscape Messaging Server 4.15) with ESMTP id HM6NQ400.13U; Fri, 3 Oct 2003 09:20:28 -0400 From: "Rob Long" To: Tom Lane Cc: pgsql-admin@postgresql.org Message-ID: <846f5914.5914846f@micropat.com> Date: Fri, 03 Oct 2003 09:20:28 -0400 X-Mailer: Netscape Webmail MIME-Version: 1.0 Content-Language: en Subject: Re: pg_restore fails - postgres 7.3.4 X-Accept-Language: en Content-Type: multipart/mixed; boundary="--1b3a7a15452b1b9c" X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=PATCH_CONTEXT_DIFF, QUOTED_EMAIL_TEXT, RCVD_IN_OSIRUSOFT_COM X-Spam-Level: X-Archive-Number: 200310/40 X-Sequence-Number: 10601 This is a multi-part message in MIME format. ----1b3a7a15452b1b9c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 7bit Tom, Will this be fixed in 7.4? Thanks for the support. Rob ----- Original Message ----- From: Tom Lane Date: Thursday, October 2, 2003 6:28 pm Subject: Re: [ADMIN] pg_restore fails - postgres 7.3.4 > "Rob Long" writes: > >>> Trying to dump and restore a production database with no success. > >>> > >>> pg_restore: [archiver (db)] could not execute query: ERROR: > data type > >>> integer has no default operator class for access method "gist" > >> > >> Hm, this is probably a matter of incorrect object restoration > order ... > >> could we see the output of "pg_restore -l" for this dump file? > > After playing around with this I realize that it's a bug > associated with > schemas --- if you have an operator class that's not in > pg_catalog, the > opclass name has to be explicitly qualified in pg_dump's output, > or it > won't restore correctly. I'm surprised no one reported this before, > since it affects all the contrib operator classes. > > Attached is a patch against 7.3.4, in case it helps. > > regards, tom lane > > ----1b3a7a15452b1b9c Content-Type: text/plain; charset="us-ascii" Content-ID: <12405.1065133640.2@sss.pgh.pa.us> Content-Description: ruleutils.patch Index: src/backend/utils/adt/ruleutils.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/adt/ruleutils.c,v retrieving revision 1.124.2.1 diff -c -r1.124.2.1 ruleutils.c *** src/backend/utils/adt/ruleutils.c 8 Jan 2003 22:54:36 -0000 1.124.2.1 --- src/backend/utils/adt/ruleutils.c 2 Oct 2003 22:21:03 -0000 *************** *** 2951,2956 **** --- 2951,2957 ---- Form_pg_opclass opcrec; char *opcname; char *nspname; + bool isvisible; /* Domains use their base type's default opclass */ if (OidIsValid(actual_datatype)) *************** *** 2962,2972 **** if (!HeapTupleIsValid(ht_opc)) elog(ERROR, "cache lookup failed for opclass %u", opclass); opcrec = (Form_pg_opclass) GETSTRUCT(ht_opc); ! if (actual_datatype != opcrec->opcintype || !opcrec->opcdefault) { /* Okay, we need the opclass name. Do we need to qualify it? */ opcname = NameStr(opcrec->opcname); ! if (OpclassIsVisible(opclass)) appendStringInfo(buf, " %s", quote_identifier(opcname)); else { --- 2963,2978 ---- if (!HeapTupleIsValid(ht_opc)) elog(ERROR, "cache lookup failed for opclass %u", opclass); opcrec = (Form_pg_opclass) GETSTRUCT(ht_opc); ! ! /* Must force use of opclass name if not in search path */ ! isvisible = OpclassIsVisible(opclass); ! ! if (actual_datatype != opcrec->opcintype || !opcrec->opcdefault || ! !isvisible) { /* Okay, we need the opclass name. Do we need to qualify it? */ opcname = NameStr(opcrec->opcname); ! if (isvisible) appendStringInfo(buf, " %s", quote_identifier(opcname)); else { ----1b3a7a15452b1b9c Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend ----1b3a7a15452b1b9c--