@@ -11522,9 +11522,7 @@ dumpOpclass(Archive *fout, OpclassInfo *opcinfo)
1152211522appendPQExpBuffer (q ,"FOR TYPE %s USING %s" ,
1152311523opcintype ,
1152411524fmtId (amname ));
11525- if (strlen (opcfamilyname )> 0 &&
11526- (strcmp (opcfamilyname ,opcinfo -> dobj .name )!= 0 ||
11527- strcmp (opcfamilynsp ,opcinfo -> dobj .namespace -> dobj .name )!= 0 ))
11525+ if (strlen (opcfamilyname )> 0 )
1152811526{
1152911527appendPQExpBufferStr (q ," FAMILY " );
1153011528if (strcmp (opcfamilynsp ,opcinfo -> dobj .namespace -> dobj .name )!= 0 )
@@ -11808,15 +11806,6 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo)
1180811806if (!opfinfo -> dobj .dump || dopt -> dataOnly )
1180911807return ;
1181011808
11811- /*
11812- * We want to dump the opfamily only if (1) it contains "loose" operators
11813- * or functions, or (2) it contains an opclass with a different name or
11814- * owner. Otherwise it's sufficient to let it be created during creation
11815- * of the contained opclass, and not dumping it improves portability of
11816- * the dump. Since we have to fetch the loose operators/funcs anyway, do
11817- * that first.
11818- */
11819-
1182011809query = createPQExpBuffer ();
1182111810q = createPQExpBuffer ();
1182211811delq = createPQExpBuffer ();
@@ -11899,40 +11888,6 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo)
1189911888
1190011889res_procs = ExecuteSqlQuery (fout ,query -> data ,PGRES_TUPLES_OK );
1190111890
11902- if (PQntuples (res_ops )== 0 && PQntuples (res_procs )== 0 )
11903- {
11904- /* No loose members, so check contained opclasses */
11905- resetPQExpBuffer (query );
11906-
11907- appendPQExpBuffer (query ,"SELECT 1 "
11908- "FROM pg_catalog.pg_opclass c, pg_catalog.pg_opfamily f, pg_catalog.pg_depend "
11909- "WHERE f.oid = '%u'::pg_catalog.oid "
11910- "AND refclassid = 'pg_catalog.pg_opfamily'::pg_catalog.regclass "
11911- "AND refobjid = f.oid "
11912- "AND classid = 'pg_catalog.pg_opclass'::pg_catalog.regclass "
11913- "AND objid = c.oid "
11914- "AND (opcname != opfname OR opcnamespace != opfnamespace OR opcowner != opfowner) "
11915- "LIMIT 1" ,
11916- opfinfo -> dobj .catId .oid );
11917-
11918- res = ExecuteSqlQuery (fout ,query -> data ,PGRES_TUPLES_OK );
11919-
11920- if (PQntuples (res )== 0 )
11921- {
11922- /* no need to dump it, so bail out */
11923- PQclear (res );
11924- PQclear (res_ops );
11925- PQclear (res_procs );
11926- destroyPQExpBuffer (query );
11927- destroyPQExpBuffer (q );
11928- destroyPQExpBuffer (delq );
11929- destroyPQExpBuffer (labelq );
11930- return ;
11931- }
11932-
11933- PQclear (res );
11934- }
11935-
1193611891/* Get additional fields from the pg_opfamily row */
1193711892resetPQExpBuffer (query );
1193811893