free(*line);
}
+ PG_CMD_PUTS("\n\n");
+
free(sysviews_setup);
}
/* Create default descriptions for operator implementation functions */
PG_CMD_PUTS("WITH funcdescs AS ( "
- "SELECT p.oid as p_oid, oprname, "
- "coalesce(obj_description(o.oid, 'pg_operator'),'') as opdesc "
+ "SELECT p.oid as p_oid, o.oid as o_oid, oprname "
"FROM pg_proc p JOIN pg_operator o ON oprcode = p.oid ) "
"INSERT INTO pg_description "
" SELECT p_oid, 'pg_proc'::regclass, 0, "
" 'implementation of ' || oprname || ' operator' "
" FROM funcdescs "
- " WHERE opdesc NOT LIKE 'deprecated%' AND "
- " NOT EXISTS (SELECT 1 FROM pg_description "
- " WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n\n");
+ " WHERE NOT EXISTS (SELECT 1 FROM pg_description "
+ " WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass) "
+ " AND NOT EXISTS (SELECT 1 FROM pg_description "
+ " WHERE objoid = o_oid AND classoid = 'pg_operator'::regclass"
+ " AND description LIKE 'deprecated%');\n\n");
/*
* Even though the tables are temp, drop them explicitly so they don't get
free(*line);
}
+ PG_CMD_PUTS("\n\n");
+
free(conv_lines);
}
" relacl IS NOT NULL"
" AND relkind IN (" CppAsString2(RELKIND_RELATION) ", "
CppAsString2(RELKIND_VIEW) ", " CppAsString2(RELKIND_MATVIEW) ", "
- CppAsString2(RELKIND_SEQUENCE) ");",
+ CppAsString2(RELKIND_SEQUENCE) ");\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" pg_attribute.attacl IS NOT NULL"
" AND pg_class.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
CppAsString2(RELKIND_VIEW) ", " CppAsString2(RELKIND_MATVIEW) ", "
- CppAsString2(RELKIND_SEQUENCE) ");",
+ CppAsString2(RELKIND_SEQUENCE) ");\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_proc"
" WHERE"
- " proacl IS NOT NULL;",
+ " proacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_type"
" WHERE"
- " typacl IS NOT NULL;",
+ " typacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_language"
" WHERE"
- " lanacl IS NOT NULL;",
+ " lanacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_largeobject_metadata"
" WHERE"
- " lomacl IS NOT NULL;",
+ " lomacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_namespace"
" WHERE"
- " nspacl IS NOT NULL;",
+ " nspacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_foreign_data_wrapper"
" WHERE"
- " fdwacl IS NOT NULL;",
+ " fdwacl IS NOT NULL;\n\n",
"INSERT INTO pg_init_privs "
" (objoid, classoid, objsubid, initprivs, privtype)"
" SELECT"
" FROM"
" pg_foreign_server"
" WHERE"
- " srvacl IS NOT NULL;",
+ " srvacl IS NOT NULL;\n\n",
NULL
};
free(*line);
}
+ PG_CMD_PUTS("\n\n");
+
free(lines);
PG_CMD_PRINTF1("UPDATE information_schema.sql_implementation_info "