upgrade.patch
text/x-patch
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| contrib/pg_upgrade/function.c | 34 | 0 |
*** a/contrib/pg_upgrade/function.c
--- b/contrib/pg_upgrade/function.c
***************
*** 11,16 ****
--- 11,17 ----
#include "pg_upgrade.h"
+ #include "pqexpbuffer.h"
#include "access/transam.h"
#define PG_UPGRADE_SUPPORT "$libdir/pg_upgrade_support"
***************
*** 141,157 **** get_loadable_libraries(void)
{
DbInfo *active_db = &old_cluster.dbarr.dbs[dbnum];
PGconn *conn = connectToServer(&old_cluster, active_db->db_name);
! /* Fetch all libraries referenced in this DB */
! ress[dbnum] = executeQueryOrDie(conn,
! "SELECT DISTINCT probin "
! "FROM pg_catalog.pg_proc "
! "WHERE prolang = 13 /* C */ AND "
! "probin IS NOT NULL AND "
! "oid >= %u;",
! FirstNormalObjectId);
totaltups += PQntuples(ress[dbnum]);
PQfinish(conn);
}
--- 142,183 ----
{
DbInfo *active_db = &old_cluster.dbarr.dbs[dbnum];
PGconn *conn = connectToServer(&old_cluster, active_db->db_name);
+ PQExpBufferData query;
! initPQExpBuffer(&query);
!
! /*
! * pg_dump doesn't export functions in pg_catalog unless (and only in
! * 9.1 and later) they are part of an extension. We therefore make
! * the same exclusions when choosing which libraries to test for.
! */
!
! appendPQExpBufferStr(&query,
! "SELECT DISTINCT probin "
! "FROM pg_catalog.pg_proc p "
! "WHERE prolang = 13 /* C */ AND"
! "probin IS NOT NULL AND "
! "oid >= %u AND ("
! "pronamespace != "
! "(SELECT oid FROM pg_catalog.pg_namespace "
! "WHERE nspname = 'pg_catalog')");
!
! if (GET_MAJOR_VERSION(old_cluster.major_version) < 901)
! appendPQExpBufferStr(&query,
! "OR EXISTS(SELECT 1 FROM pg_catalog.pg_depend "
! "WHERE classid = 'pg_proc'::regclass AND "
! "objid = p.oid AND "
! "refclassid = 'pg_extension'::regclass AND "
! "deptype = 'e')");
!
! appendPQExpBufferStr(&query,")");
!
! /* Fetch all required libraries referenced in this DB */
! ress[dbnum] = executeQueryOrDie(conn, query.data, FirstNormalObjectId);
totaltups += PQntuples(ress[dbnum]);
+ termPQExpBuffer(&query);
+
PQfinish(conn);
}