[pgpool-general: 2108] Re: pgpool-regclass No such file or directory

Nozomi Anzai anzai at sraoss.co.jp
Thu Sep 5 10:35:19 JST 2013


Hi,

> I tried this:
> [root ¡÷ node01 ~]# su - postgres
> -bash-4.1$ pg_config --libdir
> /usr/pgsql-9.2/lib
> -bash-4.1$ ll /usr/pgsql-9.2/lib | grep pgpool-
> -rwxr-xr-x 1 root root   36686 Aug  5 04:17 pgpool-recovery.so
> -rwxr-xr-x 1 root root   23214 Aug  5 04:17 pgpool-regclass.so
> 
> I also manually applied pgpool-recovery.sql and pgpool-regclass.sql as it is
> required step in the installation guide:
> su - postgres
> cp /usr/pgsql-9.2/share/extension/pgpool-regclass.sql .
> psql -f pgpool-regclass.sql template1
> psql -f pgpool-regclass.sql <database>
> 
> If I try to access the <database> I applied sql script with pgAdmin I got
> aforementioned error. I also got this error if I try to access it from
> PostgreSQL shell.
> 
> Doesn't pgpool-regclass.sql create that user function which pgpool is
> looking for? Or is it a file  /usr/pgsql-9.2/lib/pgpool-regclass? How can I
> create the file and why it is not created by Pgpool-II rpm installation?

It seems that your postgres is not /usr/pgsql-9.2 but another one. How did
you start postgres?


I tested as follows:

---------------------------------------------------------------------------

1. I have 2 of postgres: /usr/local/pgsql (which is V.9.2 installed by
   source codes) and /usr/pgsql-9.2/lib/ (which is V.9.2 installed by RPM).
   The former doen't have pgpool libraries, the latter haves them.

[root ¡÷ osspc16 ~]# updatedb
[root ¡÷ osspc16 ~]# locate bin/pg_ctl
/usr/local/pgsql/bin/pg_ctl
/usr/pgsql-9.2/bin/pg_ctl

[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/pg_config --libdir
/usr/local/pgsql/lib
[postgres ¡÷ osspc16 ~]$ ls /usr/local/pgsql/lib/ | grep pgpool

[postgres ¡÷ osspc16 ~]$ /usr/pgsql-9.2/bin/pg_config --libdir
/usr/pgsql-9.2/lib
[postgres ¡÷ osspc16 ~]$ ls /usr/pgsql-9.2/lib/ | grep pgpool
pgpool-recovery.so
pgpool-regclass.so

--------------------------------------------------------------------------

2. Postgres without pgpool libraries cannot create pgpool_regclass().
   (I think this is the same situation as your problem.)

[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/pg_ctl start -D data3/ 
[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/createdb test
[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/psql test < /usr/pgsql-9.2/share/extension/pgpool-regclass.sql ERROR:  could not
access file "$libdir/pgpool-regclass": No such file or directory
STATEMENT:  CREATE OR REPLACE FUNCTION pgpool_regclass(cstring) RETURNS oid
        AS '$libdir/pgpool-regclass', 'pgpool_regclass'
        LANGUAGE C STRICT;
ERROR:  could not access file "$libdir/pgpool-regclass": No such file or
directory

---------------------------------------------------------------------------

3. Postgres with pgpool libraries can create functions.

[postgres ¡÷ osspc16 ~]$ /usr/pgsql-9.2/bin/pg_ctl stop -D data3/
[postgres ¡÷ osspc16 ~]$ /usr/pgsql-9.2/bin/pg_ctl start -D data3/

[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/psql test
< /usr/pgsql-9.2/share/extension/pgpool-regclass.sql CREATE FUNCTION

---------------------------------------------------------------------------

4. Copying libralies is also fine.

[root ¡÷ osspc16 ~]# cd /usr/local/pgsql/lib
[root ¡÷ osspc16 lib]# ln -s /usr/pgsql-9.2/lib/pgpool-* .
[root ¡÷ osspc16 lib]# su - postgres

[postgres ¡÷ osspc16 ~]$ /usr/pgsql-9.2/bin/pg_ctl stop -D data3/
[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/pg_ctl start -D data3/

[postgres ¡÷ osspc16 ~]$ /usr/local/pgsql/bin/psql test
psql (9.2.3)
Type "help" for help.

test=# select pgpool_regclass('aaa');
 pgpool_regclass 
-----------------
               0
(1 row)

---------------------------------------------------------------------------

> >> Hi Tatsuo.
> >> 
> >> I am experiencing following message in the pgpool.log file:
> >> 
> >> do_query: error message from backend: could not access file
> >> "$libdir/pgpool-regclass": No such file or directory. Exit this session.
> >> 
> >>  
> >> 
> >> I know the Pgool cannot find regclass libraries or cannot access it. 
> >> How can I determine where does Pgpool-II expect to have these libraries?
> 
> >pgpool-regclass is a user defined PostgreSQL function and "$libdir" is
> controled by your PostgreSQL installtion, not by pgpool-II. To find out
> where $libdir actually points to, you can use:
> 
> >pg_config --libdir
> 
> Thank you for reply Tatsuo.
> 
> I installed Pgpool-II from the package pgpool-II-3.3.0-1.pgdg.x86_64.rpm
> downloaded from Pgpool download page.
> 
> I tried this:
> [root ¡÷ node01 ~]# su - postgres
> -bash-4.1$ pg_config --libdir
> /usr/pgsql-9.2/lib
> -bash-4.1$ ll /usr/pgsql-9.2/lib | grep pgpool-
> -rwxr-xr-x 1 root root   36686 Aug  5 04:17 pgpool-recovery.so
> -rwxr-xr-x 1 root root   23214 Aug  5 04:17 pgpool-regclass.so
> 
> I also manually applied pgpool-recovery.sql and pgpool-regclass.sql as it is
> required step in the installation guide:
> su - postgres
> cp /usr/pgsql-9.2/share/extension/pgpool-regclass.sql .
> psql -f pgpool-regclass.sql template1
> psql -f pgpool-regclass.sql <database>
> 
> If I try to access the <database> I applied sql script with pgAdmin I got
> aforementioned error. I also got this error if I try to access it from
> PostgreSQL shell.
> 
> Doesn't pgpool-regclass.sql create that user function which pgpool is
> looking for? Or is it a file  /usr/pgsql-9.2/lib/pgpool-regclass? How can I
> create the file and why it is not created by Pgpool-II rpm installation?
> 
> Best regards,
> Michal Mistina
> 


-- 
Nozomi Anzai
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list