pgpool2.git / summary / log / commit / refs
commit 09dc8e05c93db65c5d857fd6871df59e704f084f
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat May 26 05:13:00 2012 +0000
Adopt PostgreSQL 9.2.
sql/pgpool-regclass/pgpool-regclass.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/sql/pgpool-regclass/pgpool-regclass.c b/sql/pgpool-regclass/pgpool-regclass.c
index fc73a4479..2b9e40689 100644
--- a/sql/pgpool-regclass/pgpool-regclass.c
+++ b/sql/pgpool-regclass/pgpool-regclass.c
@@ -2,7 +2,7 @@
/*
* $Header$
*
- * Copyright (c) 2003-2011 PgPool Global Development Group
+ * Copyright (c) 2003-2012 PgPool Global Development Group
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -95,9 +95,14 @@ pgpool_regclass(PG_FUNCTION_ARGS)
if (get_namespace_oid(rel->schemaname, true) == InvalidOid)
PG_RETURN_OID(InvalidOid);
}
-
+#if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90200)
result = RangeVarGetRelid(rel, true);
-
+#else
+ /* RangeVarGetRelid() of PostgreSQL 9.2 or later, has third
+ * argument "missing_ok" which suppresses ERROR exception, but
+ * returns invlaid_oid. See include/catalog/namespace.h */
+ result = RangeVarGetRelid(rel, true, true);
+#endif
PG_RETURN_OID(result);
}
[parent: d39b5565dc4b]