> Hello. I'm working on installing pgpool-II 3.0.2 on an Ubuntu 10.04
> server 64-bit machine. We're running Postgres 8.4. The compile and
> install of pgpool itself went fine, as did the make/install of
> pgpool_regclass. However, when I run the SQL command to activate the
> new module, I get the error shown below.
>
> Can anybody on the list shed some light on what is wrong?
>
> Thanks!
>
>
> ploron@coho:~/pgpool-II-3.0.2/sql/pgpool-regclass$ psql
> --username=postgres -f pgpool-regclass.sql template1
> psql:pgpool-regclass.sql:4: ERROR: could not load library
> "/usr/lib/postgresql/8.4/lib/pgpool-regclass.so":
> /usr/lib/postgresql/8.4/lib/pgpool-regclass.so: undefined symbol:
> LookupNamespaceNoError
I have made fixes on pgpool-II 3.0 stable release. Please grab from
CVS(V3_0_STABLE branch) or apply attached patches.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
Index: pgpool-regclass.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/sql/pgpool-regclass/pgpool-regclass.c,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -c -r1.1.2.1 -r1.1.2.2
*** pgpool-regclass.c 26 Jan 2011 01:28:16 -0000 1.1.2.1
--- pgpool-regclass.c 28 Feb 2011 00:54:48 -0000 1.1.2.2
***************
*** 1,6 ****
/* -*-pgsql-c-*- */
/*
! * $Header: /cvsroot/pgpool/pgpool-II/sql/pgpool-regclass/pgpool-regclass.c,v 1.1.2.1 2011/01/26 01:28:16 t-ishii Exp $
*
* Copyright (c) 2003-2011 PgPool Global Development Group
*
--- 1,6 ----
/* -*-pgsql-c-*- */
/*
! * $Header: /cvsroot/pgpool/pgpool-II/sql/pgpool-regclass/pgpool-regclass.c,v 1.1.2.2 2011/02/28 00:54:48 t-ishii Exp $
*
* Copyright (c) 2003-2011 PgPool Global Development Group
*
***************
*** 25,30 ****
--- 25,31 ----
#include <unistd.h>
#include "postgres.h"
#include "utils/builtins.h"
+ #include "utils/syscache.h"
#include "utils/elog.h"
#include "catalog/namespace.h"
#include "nodes/makefuncs.h"
***************
*** 50,55 ****
--- 51,59 ----
extern Oid MyDatabaseId;
+ static Oid
+ get_namespace_oid(const char *nspname, bool missing_ok);
+
Datum
pgpool_regclass(PG_FUNCTION_ARGS)
{
***************
*** 86,92 ****
*/
if (rel->schemaname)
{
! if (LookupNamespaceNoError(rel->schemaname) == InvalidOid)
PG_RETURN_OID(InvalidOid);
}
--- 90,96 ----
*/
if (rel->schemaname)
{
! if (get_namespace_oid(rel->schemaname, true) == InvalidOid)
PG_RETURN_OID(InvalidOid);
}
***************
*** 137,143 ****
--- 141,155 ----
static RangeVar *
MymakeRangeVarFromNameList(List *names)
{
+ /*
+ * Number of arguments of makeRangeVar() has been increased in 8.4 or
+ * later.
+ */
+ #if PG_VERSION_NUM >= 80400
RangeVar *rel = makeRangeVar(NULL, NULL, -1);
+ #else
+ RangeVar *rel = makeRangeVar(NULL, NULL);
+ #endif
switch (list_length(names))
{
***************
*** 160,162 ****
--- 172,197 ----
return rel;
}
+
+ /*
+ * get_namespace_oid - given a namespace name, look up the OID
+ *
+ * If missing_ok is false, throw an error if namespace name not found. If
+ * true, just return InvalidOid.
+ *
+ * This function was stolen from PostgreSQL 9.0 and modified to not
+ * use GetSysCacheOid1. Since it is new in 9.0.
+ */
+ static Oid
+ get_namespace_oid(const char *nspname, bool missing_ok)
+ {
+ Oid oid;
+
+ oid = GetSysCacheOid(NAMESPACENAME, CStringGetDatum(nspname), 0, 0, 0);
+ if (!OidIsValid(oid) && !missing_ok)
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_SCHEMA),
+ errmsg("schema \"%s\" does not exist", nspname)));
+
+ return oid;
+ }
_______________________________________________
Pgpool-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-general