Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aql3Q-00068k-54 for pgsql-general@arkaria.postgresql.org; Thu, 14 Apr 2016 17:27:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1aql3P-0007Us-O0 for pgsql-general@arkaria.postgresql.org; Thu, 14 Apr 2016 17:27:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1aqMmP-0004MR-2r for pgsql-general@postgresql.org; Wed, 13 Apr 2016 15:32:33 +0000 Received: from util-st-02.imsweb.com ([204.132.58.65]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqMmI-0002KU-2v for pgsql-general@postgresql.org; Wed, 13 Apr 2016 15:32:32 +0000 Received: from PAN.omni.imsweb.com (pan.omni.imsweb.com [172.22.64.64]) by util-st-02.imsweb.com (Postfix) with ESMTP id E7724E1643; Wed, 13 Apr 2016 11:32:23 -0400 (EDT) Received: from NAIAD.omni.imsweb.com (172.22.64.103) by PAN.omni.imsweb.com (172.22.64.64) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 13 Apr 2016 11:32:23 -0400 Received: from NAIAD.omni.imsweb.com ([172.22.64.103]) by NAIAD.omni.imsweb.com ([172.22.64.103]) with mapi id 15.00.1178.000; Wed, 13 Apr 2016 11:32:23 -0400 From: "Feld, Michael (IMS)" To: Tom Lane CC: "pgsql-general@postgresql.org" Subject: Re: pg_upgrade error regarding hstore operator Thread-Topic: [GENERAL] pg_upgrade error regarding hstore operator Thread-Index: AdF5Z2tvCSwX6/yiTD6b7QV8/DOIOgAAJ0qwABTKRoAFoXlUUAAOKIEAAB8uY5ABC8AqgAAc0HTQ Date: Wed, 13 Apr 2016 15:32:23 +0000 Message-ID: <537e590bee35426cb382ad2b66bae43d@NAIAD.omni.imsweb.com> References: <4b5993299ed948728e2ad6e278861807@NAIAD.omni.imsweb.com> <22170.1457479307@sss.pgh.pa.us> <15c0241a4a14409d9bda8c29a9673d68@NAIAD.omni.imsweb.com> <4937.1459983664@sss.pgh.pa.us> <18103.1460497225@sss.pgh.pa.us> In-Reply-To: <18103.1460497225@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [204.132.58.76] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Thanks for the reply Tom. For the first query, I get the following result o= n both 9.1 and pg_upgrade'd 9.5. SELECT am.amname AS index_method, opf.opfname AS opfamily_name, amop.amopopr::regoperator AS opfamily_operator FROM pg_am am, pg_opfamily opf, pg_amop amop WHERE opf.opfmethod =3D am.oid AND amop.amopfamily =3D opf.oid and opf.opfname like '%hstore%' ORDER BY index_method, opfamily_name, opfamily_operator; index_method;opfamily_name;opfamily_operator "btree";"btree_hstore_ops";"=3D(hstore,hstore)" "btree";"btree_hstore_ops";"#>#(hstore,hstore)" "btree";"btree_hstore_ops";"#>=3D#(hstore,hstore)" "btree";"btree_hstore_ops";"#<#(hstore,hstore)" "btree";"btree_hstore_ops";"#<=3D#(hstore,hstore)" "gin";"gin_hstore_ops";"?(hstore,text)" "gin";"gin_hstore_ops";"?|(hstore,text[])" "gin";"gin_hstore_ops";"?&(hstore,text[])" "gin";"gin_hstore_ops";"@>(hstore,hstore)" "gist";"gist_hstore_ops";"?(hstore,text)" "gist";"gist_hstore_ops";"?|(hstore,text[])" "gist";"gist_hstore_ops";"?&(hstore,text[])" "gist";"gist_hstore_ops";"@>(hstore,hstore)" "gist";"gist_hstore_ops";"@(hstore,hstore)" "hash";"hash_hstore_ops";"=3D(hstore,hstore)" For the second query you provided, I get this for the database on 9.1: select * from pg_opclass where opcintype =3D 'hstore'::regtype; opcmethod;opcname;opcnamespace;opcowner;opcfamily;opcintype;opcdefault;opck= eytype 403;"btree_hstore_ops";2200;16384;325462122;325462056;t;0 405;"hash_hstore_ops";2200;16384;325462131;325462056;t;0 783;"gist_hstore_ops";2200;16384;325462146;325462056;t;325462135 2742;"gin_hstore_ops";2200;16384;325462163;325462056;t;25 And this for the same database on pg_upgrade'd 9.5: opcmethod;opcname;opcnamespace;opcowner;opcfamily;opcintype;opcdefault;opck= eytype 403;"btree_hstore_ops";2200;16384;17079;325462056;t;0 2742;"gin_hstore_ops";2200;16384;17087;325462056;t;25 783;"gist_hstore_ops";2200;16384;17097;325462056;t;325462135 405;"hash_hstore_ops";2200;16384;17111;325462056;t;0 In addition, I noticed the following differences in the pg_depend catalog, = there are 4 entries in 9.1 that are missing in 9.5 which I have separated w= ith ***: select classid::regclass, objid, objsubid, refclassid::regclass, refobjid, = refobjsubid, deptype, opcname, opfname from pg_depend pgd left join pg_opcl= ass on pgd.objid =3D pg_opclass.oid left join pg_opfamily on pgd.objid =3D = pg_opfamily.oid where classid in ('pg_opfamily'::regclass, 'pg_opclass'::re= gclass) order by 7,8,9; 9.1: classid;objid;objsubid;refclassid;refobjid;refobjsubid;deptype;opcname;opfn= ame "pg_opclass";325462123;0;"pg_opfamily";325462122;0;"a";"btree_hstore_ops";"" "pg_opclass";325462164;0;"pg_opfamily";325462163;0;"a";"gin_hstore_ops";"" "pg_opclass";325462147;0;"pg_opfamily";325462146;0;"a";"gist_hstore_ops";"" "pg_opclass";325462132;0;"pg_opfamily";325462131;0;"a";"hash_hstore_ops";"" "pg_opclass";325462123;0;"pg_extension";325462055;0;"e";"btree_hstore_ops";= "" "pg_opclass";325462164;0;"pg_extension";325462055;0;"e";"gin_hstore_ops";"" "pg_opclass";325462147;0;"pg_extension";325462055;0;"e";"gist_hstore_ops";"" "pg_opclass";325462132;0;"pg_extension";325462055;0;"e";"hash_hstore_ops";"" *** "pg_opfamily";325462122;0;"pg_extension";325462055;0;"e";"";"btree_hstore_o= ps" "pg_opfamily";325462163;0;"pg_extension";325462055;0;"e";"";"gin_hstore_ops" "pg_opfamily";325462146;0;"pg_extension";325462055;0;"e";"";"gist_hstore_op= s" "pg_opfamily";325462131;0;"pg_extension";325462055;0;"e";"";"hash_hstore_op= s" *** "pg_opclass";325462123;0;"pg_type";325462056;0;"n";"btree_hstore_ops";"" "pg_opclass";325462123;0;"pg_namespace";2200;0;"n";"btree_hstore_ops";"" "pg_opclass";325462164;0;"pg_namespace";2200;0;"n";"gin_hstore_ops";"" "pg_opclass";325462164;0;"pg_type";325462056;0;"n";"gin_hstore_ops";"" "pg_opclass";325462147;0;"pg_type";325462056;0;"n";"gist_hstore_ops";"" "pg_opclass";325462147;0;"pg_type";325462135;0;"n";"gist_hstore_ops";"" "pg_opclass";325462147;0;"pg_namespace";2200;0;"n";"gist_hstore_ops";"" "pg_opclass";325462132;0;"pg_type";325462056;0;"n";"hash_hstore_ops";"" "pg_opclass";325462132;0;"pg_namespace";2200;0;"n";"hash_hstore_ops";"" "pg_opfamily";325462122;0;"pg_namespace";2200;0;"n";"";"btree_hstore_ops" "pg_opfamily";325462163;0;"pg_namespace";2200;0;"n";"";"gin_hstore_ops" "pg_opfamily";325462146;0;"pg_namespace";2200;0;"n";"";"gist_hstore_ops" "pg_opfamily";325462131;0;"pg_namespace";2200;0;"n";"";"hash_hstore_ops" 9.5: classid;objid;objsubid;refclassid;refobjid;refobjsubid;deptype;opcname;opfn= ame "pg_opclass";17080;0;"pg_opfamily";17079;0;"a";"btree_hstore_ops";"" "pg_opclass";17088;0;"pg_opfamily";17087;0;"a";"gin_hstore_ops";"" "pg_opclass";17098;0;"pg_opfamily";17097;0;"a";"gist_hstore_ops";"" "pg_opclass";17112;0;"pg_opfamily";17111;0;"a";"hash_hstore_ops";"" "pg_opclass";17080;0;"pg_extension";16651;0;"e";"btree_hstore_ops";"" "pg_opclass";17088;0;"pg_extension";16651;0;"e";"gin_hstore_ops";"" "pg_opclass";17098;0;"pg_extension";16651;0;"e";"gist_hstore_ops";"" "pg_opclass";17112;0;"pg_extension";16651;0;"e";"hash_hstore_ops";"" "pg_opclass";17080;0;"pg_type";325462056;0;"n";"btree_hstore_ops";"" "pg_opclass";17080;0;"pg_namespace";2200;0;"n";"btree_hstore_ops";"" "pg_opclass";17088;0;"pg_namespace";2200;0;"n";"gin_hstore_ops";"" "pg_opclass";17088;0;"pg_type";325462056;0;"n";"gin_hstore_ops";"" "pg_opclass";17098;0;"pg_type";325462056;0;"n";"gist_hstore_ops";"" "pg_opclass";17098;0;"pg_type";325462135;0;"n";"gist_hstore_ops";"" "pg_opclass";17098;0;"pg_namespace";2200;0;"n";"gist_hstore_ops";"" "pg_opclass";17112;0;"pg_type";325462056;0;"n";"hash_hstore_ops";"" "pg_opclass";17112;0;"pg_namespace";2200;0;"n";"hash_hstore_ops";"" "pg_opfamily";17079;0;"pg_namespace";2200;0;"n";"";"btree_hstore_ops" "pg_opfamily";17087;0;"pg_namespace";2200;0;"n";"";"gin_hstore_ops" "pg_opfamily";17097;0;"pg_namespace";2200;0;"n";"";"gist_hstore_ops" "pg_opfamily";17111;0;"pg_namespace";2200;0;"n";"";"hash_hstore_ops" output of \dx+ hstore: 9.1 cast from text[] to hstore function akeys(hstore) function avals(hstore) function defined(hstore,text) function delete(hstore,hstore) function delete(hstore,text) function delete(hstore,text[]) function each(hstore) function exist(hstore,text) function exists_all(hstore,text[]) function exists_any(hstore,text[]) function fetchval(hstore,text) function ghstore_compress(internal) function ghstore_consistent(internal,internal,integer,oid,internal) function ghstore_decompress(internal) function ghstore_in(cstring) function ghstore_out(ghstore) function ghstore_penalty(internal,internal,internal) function ghstore_picksplit(internal,internal) function ghstore_same(internal,internal,internal) function ghstore_union(internal,internal) function gin_consistent_hstore(internal,smallint,internal,integer,internal= ,internal) function gin_extract_hstore(internal,internal) function gin_extract_hstore_query(internal,internal,smallint,internal,inte= rnal) function hs_concat(hstore,hstore) function hs_contained(hstore,hstore) function hs_contains(hstore,hstore) function hstore(record) function hstore(text,text) function hstore(text[]) function hstore(text[],text[]) function hstore_cmp(hstore,hstore) function hstore_eq(hstore,hstore) function hstore_ge(hstore,hstore) function hstore_gt(hstore,hstore) function hstore_hash(hstore) function hstore_in(cstring) function hstore_le(hstore,hstore) function hstore_lt(hstore,hstore) function hstore_ne(hstore,hstore) function hstore_out(hstore) function hstore_recv(internal) function hstore_send(hstore) function hstore_to_array(hstore) function hstore_to_matrix(hstore) function hstore_version_diag(hstore) function isdefined(hstore,text) function isexists(hstore,text) function populate_record(anyelement,hstore) function skeys(hstore) function slice(hstore,text[]) function slice_array(hstore,text[]) function svals(hstore) function tconvert(text,text) operator #<#(hstore,hstore) operator #<=3D#(hstore,hstore) operator #=3D(anyelement,hstore) operator #>#(hstore,hstore) operator #>=3D#(hstore,hstore) operator %#(NONE,hstore) operator %%(NONE,hstore) operator -(hstore,hstore) operator -(hstore,text) operator -(hstore,text[]) operator ->(hstore,text) operator ->(hstore,text[]) operator <>(hstore,hstore) operator <@(hstore,hstore) operator =3D(hstore,hstore) operator =3D>(text,text) operator ?&(hstore,text[]) operator ?(hstore,text) operator ?|(hstore,text[]) operator @(hstore,hstore) operator @>(hstore,hstore) operator class btree_hstore_ops for access method btree operator class gin_hstore_ops for access method gin operator class gist_hstore_ops for access method gist operator class hash_hstore_ops for access method hash 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 operator ||(hstore,hstore) operator ~(hstore,hstore) type ghstore type hstore 9.5: cast from text[] to hstore function akeys(hstore) function avals(hstore) function defined(hstore,text) function delete(hstore,hstore) function delete(hstore,text) function delete(hstore,text[]) function each(hstore) function exist(hstore,text) function exists_all(hstore,text[]) function exists_any(hstore,text[]) function fetchval(hstore,text) function ghstore_compress(internal) function ghstore_consistent(internal,internal,integer,oid,internal) function ghstore_decompress(internal) function ghstore_in(cstring) function ghstore_out(ghstore) function ghstore_penalty(internal,internal,internal) function ghstore_picksplit(internal,internal) function ghstore_same(internal,internal,internal) function ghstore_union(internal,internal) function gin_consistent_hstore(internal,smallint,internal,integer,internal= ,internal) function gin_extract_hstore(internal,internal) function gin_extract_hstore_query(internal,internal,smallint,internal,inte= rnal) function hs_concat(hstore,hstore) function hs_contained(hstore,hstore) function hs_contains(hstore,hstore) function hstore(record) function hstore(text,text) function hstore(text[]) function hstore(text[],text[]) function hstore_cmp(hstore,hstore) function hstore_eq(hstore,hstore) function hstore_ge(hstore,hstore) function hstore_gt(hstore,hstore) function hstore_hash(hstore) function hstore_in(cstring) function hstore_le(hstore,hstore) function hstore_lt(hstore,hstore) function hstore_ne(hstore,hstore) function hstore_out(hstore) function hstore_recv(internal) function hstore_send(hstore) function hstore_to_array(hstore) function hstore_to_matrix(hstore) function hstore_version_diag(hstore) function isdefined(hstore,text) function isexists(hstore,text) function populate_record(anyelement,hstore) function skeys(hstore) function slice(hstore,text[]) function slice_array(hstore,text[]) function svals(hstore) function tconvert(text,text) operator #<#(hstore,hstore) operator #<=3D#(hstore,hstore) operator #=3D(anyelement,hstore) operator #>#(hstore,hstore) operator #>=3D#(hstore,hstore) operator %#(NONE,hstore) operator %%(NONE,hstore) operator -(hstore,hstore) operator -(hstore,text) operator -(hstore,text[]) operator ->(hstore,text) operator ->(hstore,text[]) operator <>(hstore,hstore) operator <@(hstore,hstore) operator =3D(hstore,hstore) operator ?&(hstore,text[]) operator ?(hstore,text) operator ?|(hstore,text[]) operator @(hstore,hstore) operator @>(hstore,hstore) operator class btree_hstore_ops for access method btree operator class gin_hstore_ops for access method gin operator class gist_hstore_ops for access method gist operator class hash_hstore_ops for access method hash operator ||(hstore,hstore) operator ~(hstore,hstore) type ghstore type hstore (82 rows) Thanks again for you time and assistance, Mike -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Tuesday, April 12, 2016 5:40 PM To: Feld, Michael (IMS) Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] pg_upgrade error regarding hstore operator "Feld, Michael (IMS)" writes: > Thanks for the reply Tom. template1 is definitely empty and does not cont= ain any hstore objects. I did a little debugging and placed the below SQL b= efore and after the hstore creation in the file produced by the pg_dump and= determined that these operator objects only become present immediately aft= er the creation of the hstore extension, and not before. Then, much later d= own the pg_dump file, it attempts to create the operator family for these 4= items producing the errors. I did a pg_dump of the same database on a 9.1 = instance and it does not produce the operator creation objects SQL outside = of the extension. This seems to be something that happened as part of the p= g_upgrade. Any idea why these have showed up outside the extension? Is ther= e anything I can do to fix this? Thanks for all of your help. I got some time today to try to reproduce this problem, and failed. What I did was: * install hstore 1.0 extension in a 9.1 database * upgrade the extension to 1.1 (as per instructions upthread) * pg_upgrade the database to HEAD * pg_dump the database The pg_dump output shows the expected CREATE EXTENSION command and no other= extraneous objects. So the procedure is fine. I have to conclude there w= as something weird about the initial state of your 9.1 database. I have too little info to say what exactly. > SELECT am.amname AS index_method, > opf.opfname AS opfamily_name, > amop.amopopr::regoperator AS opfamily_operator > FROM pg_am am, pg_opfamily opf, pg_amop amop > WHERE opf.opfmethod =3D am.oid AND > amop.amopfamily =3D opf.oid and opf.opfname like '%hstore%' > ORDER BY index_method, opfamily_name, opfamily_operator; Uh, what did you get from that query? Might also be useful to see select * from pg_opclass where opcintype =3D 'hstore'::regtype; and the output of "\dx+ hstore" in psql. 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 empl= oyee or agent of the addressee(s), please note that any dissemination, dist= ribution, or copying of this communication is strictly prohibited. If you h= ave received this e-mail in error, please notify the sender of the error. --=20 Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general