Search Postgresql Archives

Re: pg_upgrade error regarding hstore operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the assist Tom. That worked for us. Noticing a different issue following the pg_upgrade. If we take a pg_dump of a database on this upgraded instance with the hstore extension and try to pg_restore it back up to the same instance we get the following errors (ignore the likeness to your name, apparently when this cluster was created years ago they chose to set it up in your honor):

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3879; 2753 745119 OPERATOR FAMILY btree_        hstore_ops tomlane
pg_restore: [archiver (db)] could not execute query: ERROR:  operator family "btree_hstore_ops" for access method "btree" already exists
    Command was: CREATE OPERATOR FAMILY btree_hstore_ops USING btree;

pg_restore: [archiver (db)] Error from TOC entry 3880; 2753 745127 OPERATOR FAMILY gin_hs        tore_ops tomlane
pg_restore: [archiver (db)] could not execute query: ERROR:  operator family "gin_hstore_ops" for access method "gin" already exists
    Command was: CREATE OPERATOR FAMILY gin_hstore_ops USING gin;

pg_restore: [archiver (db)] Error from TOC entry 3881; 2753 745137 OPERATOR FAMILY gist_h        store_ops tomlane
pg_restore: [archiver (db)] could not execute query: ERROR:  operator family "gist_hstore_ops" for access method "gist" already exists
    Command was: CREATE OPERATOR FAMILY gist_hstore_ops USING gist;

pg_restore: [archiver (db)] Error from TOC entry 3882; 2753 745151 OPERATOR FAMILY hash_h        store_ops tomlane
pg_restore: [archiver (db)] could not execute query: ERROR:  operator family "hash_hstore_ops" for access method "hash" already exists
    Command was: CREATE OPERATOR FAMILY hash_hstore_ops USING hash;

We do not have this issue for any new databases created following the pg_upgrade. I noticed that new databases have the hstore 1.3 version while the originals still have the 1.1 version. I updated the extension on one of these to see if that would resolve the issue and it did not. Thanks for any help you can offer.

-----Original Message-----
From: Tom Lane [mailto:tgl@xxxxxxxxxxxxx]
Sent: Tuesday, March 08, 2016 6:22 PM
To: Feld, Michael (IMS) <FeldM@xxxxxxxxxx>
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Re:  pg_upgrade error regarding hstore operator

"Feld, Michael (IMS)" <FeldM@xxxxxxxxxx> writes:
> I am attempting to upgrade my organization's database cluster from
> 9.1.19 to 9.5.1 using the pg_upgrade utility.

That's kind of a big jump :-( ... you missed the versions where => was deprecated as an operator name.

> I tried dropping the operator before doing the upgrade but it's dependent on the existence of the hstore extension. Ideas?

The clean solution would be to copy share/extension/hstore--1.0--1.1.sql
from the 9.5 installation into the 9.1 installation and then do

ALTER EXTENSION hstore UPDATE TO '1.1';

Under the hood that's just doing

ALTER EXTENSION hstore DROP OPERATOR => (text, text); DROP OPERATOR => (text, text);

but if you did that manually, you'd have a problem when you want to update hstore to current versions later.  If you do what I suggest, the extension will properly look like it's 1.1 after pg_upgrade'ing.

regards, tom lane

________________________________

Information in this e-mail may be confidential. It is intended only for the addressee(s) identified above. If you are not the addressee(s), or an employee or agent of the addressee(s), please note that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this e-mail in error, please notify the sender of the error.


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux