Re: BUG #14181: pg_upgrade: operator family "btree_hstore_ops" does not exist

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: worden(dot)eric(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14181: pg_upgrade: operator family "btree_hstore_ops" does not exist
Date: 2016-06-07 22:27:03
Message-ID: 17028.1465338423@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

worden(dot)eric(at)gmail(dot)com writes:
> I'm attempting to upgrade from 9.4.8. hstore installed version on the 9.4
> cluster is 1.3. It also failed with version 1.2.

> pg_upgrade is exiting with failure during the step "Restoring database
> schemas in the new cluster". Several database schemas are restored
> successfully, then one fails. The pg_restore log indicated by the pg_upgrade
> output ends with:

> pg_restore: [archiver (db)] could not execute query: ERROR: operator family
> "btree_hstore_ops" does not exist for access method "btree"
> Command was: CREATE OPERATOR CLASS "btree_hstore_ops"
> DEFAULT FOR TYPE "hstore" USING "btree" FAMILY "btree_hstore_ops" AS
> OPERAT...

Hmm. Is there, by any chance, a CREATE OPERATOR FAMILY "btree_hstore_ops"
command somewhere later in the dump? Also, if you do
\dx+ hstore
in the problematic 9.4 database, do you see lines like
operator family btree_hstore_ops for access method btree
operator family gin_hstore_ops for access method gin
operator family gist_hstore_ops for access method gist
operator family hash_hstore_ops for access method hash
? I'm suspicious that there may only be operator classes, not operator
families, linked to the extension.

If you don't see them, then I'm betting that you previously pg_upgraded
this same database from 9.3 or before, and fell victim to a bug we
recently fixed that caused pg_upgrade to drop such operator families
from their extensions. You could fix that with manual ALTER EXTENSION
ADD OPERATOR FAMILY commands in affected database(s). After that,
pg_upgrade'ing should work.

> The documentation for CREATE OPERATOR CLASS says that the operator family
> will be created if it does not already exist, contrary to what the error
> message says here.

Not if there's an explicit FAMILY clause; that's supposed to refer to
a pre-existing family.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bo Ørsted Andresen 2016-06-08 00:24:38 Re: BUG #14180: Segmentation fault on replication slave
Previous Message worden.eric 2016-06-07 22:05:20 BUG #14181: pg_upgrade: operator family "btree_hstore_ops" does not exist