postgresql-pgpool-II/pgpool-3.2-build-against-postgresql-9.3.patch
Pavel Raiskup 13fc64546d pgpool-II: patch for postgresql 9.3
Resolves: #1007855
Version: 3.2.0-4
2013-09-19 13:14:23 +02:00

47 lines
1.8 KiB
Diff

commit 2e9a136413473e799cf9ee3cd30a9ae40cf8e7c1
Author: Tatsuo Ishii <ishii@postgresql.org>
AuthorDate: Wed Apr 3 16:20:15 2013 +0900
Commit: Tatsuo Ishii <ishii@postgresql.org>
CommitDate: Wed Apr 3 16:20:15 2013 +0900
Adopt PostgreSQL 9.3. Patch contributed by Asif Rehman.
Slight editing by Tatsuo Ishii.
diff --git a/sql/pgpool-recovery/pgpool-recovery.c b/sql/pgpool-recovery/pgpool-recovery.c
index 8408e3f..4f47e2c 100644
--- a/sql/pgpool-recovery/pgpool-recovery.c
+++ b/sql/pgpool-recovery/pgpool-recovery.c
@@ -4,7 +4,7 @@
*
* pgpool-recovery: exec online recovery script from SELECT statement.
*
- * Copyright (c) 2003-2010 PgPool Global Development Group
+ * Copyright (c) 2003-2013 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -29,6 +29,9 @@
#include "catalog/namespace.h"
#include "utils/syscache.h"
#include "utils/builtins.h" /* PostgreSQL 8.4 needs this for textout */
+#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 90300)
+#include "access/htup_details.h" /* PostgreSQL 9.3 or later needs this */
+#endif
#define REMOTE_START_FILE "pgpool_remote_start"
@@ -198,7 +201,14 @@ get_function_oid(const char *funcname, const char *argtype, const char *nspname)
oid_v = buildoidvector(NULL, 0);
}
+#if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90300)
nspid = LookupExplicitNamespace(nspname);
+#else
+ /* LookupExplicitNamespace() of PostgreSQL 9.3 or later, has third
+ * argument "missing_ok" which suppresses ERROR exception, but
+ * returns invlaid_oid. See include/catalog/namespace.h */
+ nspid = LookupExplicitNamespace(nspname, false);
+#endif
elog(DEBUG1, "get_function_oid: oid of \"%s\": %d", nspname, nspid);
tup = SearchSysCache(PROCNAMEARGSNSP,