pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Long <rlong@micropat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_restore fails - postgres 7.3.4
Date: Fri, 03 Oct 2003 09:20:28 -0400
Message-ID: <846f5914.5914846f@micropat.com> (raw)

Tom,

Will this be fixed in 7.4?

Thanks for the support.

Rob

----- Original Message -----
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thursday, October 2, 2003 6:28 pm
Subject: Re: [ADMIN] pg_restore fails - postgres 7.3.4 

> "Rob Long" <rlong@micropat.com> 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
> 
> 
inline patch 1: src/backend/utils/adt/ruleutils.c (+8/-2 lines) download inline-1.patchIndex: 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 {
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend

view thread (7+ messages)  latest in thread

Message-ID: <846f5914.5914846f@micropat.com>
Permalink:  ../846f5914.5914846f@micropat.com/
Also on:    postgresql.org/message-id/846f5914.5914846f@micropat.com

 ·  · 

reply

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-admin@postgresql.org
  Cc: rlong@micropat.com, tgl@sss.pgh.pa.us
  Subject: Re: pg_restore fails - postgres 7.3.4
  In-Reply-To: <846f5914.5914846f@micropat.com>
  References: <846f5914.5914846f@micropat.com>

* 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