Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Erwin Moller <erwin(at)darwine(dot)nl>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist
Date: 2019-08-20 13:32:42
Message-ID: bdea8b76-3f58-3185-65a4-df6a0fd93464@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/20/19 6:18 AM, Erwin Moller wrote:
>
>
> Op 8/20/2019 om 2:07 PM schreef Ian Barwick:
>> On 8/20/19 7:12 PM, Erwin Moller wrote:
>>> Hi,
>>>
>>> While trying to move an old 8.1 Postgres install to a new server with
>>> postgres 10.10, I get an error, listed hereunder:
>>> I am trying to get a mydump_x_x_x.sql file to use to reinstall on the
>>> target machine.
>>>
>>>  From my new machine I connect to my old machine like this:
>>> erwin(at)ubuntu:~$  pg_dump -f "/home/erwin/mydump_$(date
>>> +%d_%m_%Y).sql" -C -h somehost.com -p 5433 -U myvalidusername -d
>>> myremotedb
>>> Password:
>>> pg_dump: [archiver (db)] query failed: ERROR:  relation "pg_opfamily"
>>> does not exist
>>> pg_dump: [archiver (db)] query was: SELECT classid, objid,
>>> refclassid, refobjid, deptype FROM pg_depend WHERE deptype != 'p' AND
>>> deptype != 'e'
>>> UNION ALL
>>> SELECT 'pg_opfamily'::regclass AS classid, amopfamily AS objid,
>>> refclassid, refobjid, deptype FROM pg_depend d, pg_amop o WHERE
>>> deptype NOT IN ('p', 'e', 'i') AND classid = 'pg_amop'::regclass AND
>>> objid = o.oid AND NOT (refclassid = 'pg_opfamily'::regclass AND
>>> amopfamily = refobjid)
>>> UNION ALL
>>> SELECT 'pg_opfamily'::regclass AS classid, amprocfamily AS objid,
>>> refclassid, refobjid, deptype FROM pg_depend d, pg_amproc p WHERE
>>> deptype NOT IN ('p', 'e', 'i') AND classid = 'pg_amproc'::regclass
>>> AND objid = p.oid AND NOT (refclassid = 'pg_opfamily'::regclass AND
>>> amprocfamily = refobjid)
>>> ORDER BY 1,2
>>>
>>> And no archive is created.
>>>
>>> Does any of you kind people have advice? I am sure this worked on
>>> postgres9.
>>
>> It looks like this was broken just before 10.10 was released, and has
>> since been fixed;
>> see:
>>
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=6844adba54f7d96f30f834efc6d9aa1e52e5672d
>>
>>
>> Your options are:
>>  - find a 10.9 or earlier package and use the pg_dump from that
>>  - build pg_dump yourself
>>  - wait for 10.11 to come out (though I imagine that won't be for a
>> month or two)
>>
>>
>> Regards
>>
>> Ian Barwick
>>
>
> Thanks a lot, Ian!
>
> That saved me an upcoming headache. I searched a lot on Google but
> couldn't find any relevant information.
>
> Will installing Postgres 11 also work? (Not the Ubuntu18.04 default for
> Postgres, but doable).
> Or does those pg_dump versions also expect pg_opfamily to exist?

From the bug that introduced the issue:

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=07b39083c

"Per bug #15934 from Tom Gottfried. Back-patch to all supported branches."

So I'm guessing it is in the most recent release of all current versions.

>
> Thanks for your time!
>
> Regards,
> Erwin Moller
>
>
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-08-20 13:59:07 Re: Can SELECT … NOWAIT “deadlock”?
Previous Message Erwin Moller 2019-08-20 13:18:50 Re: pg_dump problems: [archiver (db)] query failed: ERROR: relation "pg_opfamily" does not exist