[pgpool-general: 4555] Re: pgpool_adm extension

Muhammad Usama m.usama at gmail.com
Wed Mar 16 00:34:12 JST 2016


pgpool_adm module implements two kinds of functions. One those takes,
username, password, server address and port as a parameter and second type
gets these credentials from foreign server and takes the foreign server
name as an argument.

Signature of pcp_node_info that takes everything as an argument.
pcp_node_info(integer node_id, text host, integer port, text username, text
password, OUT status text, OUT weight float4) returns record

Signature of pcp_node_info that takes foreign server name.
pcp_node_info(integer node_id, text pcp_server, OUT status text, OUT weight
float4) returns record

See for more details
http://www.pgpool.net/docs/latest/pgpool-en.html#pgpool_adm


Now you are trying to call *pcp_node_info* that takes the foreign server
name as an argument. (SELECT * FROM pgpool.pcp_node_info(0, 'localhost');)
So Have you added the foreign server named 'localhost'?

I can successfully execute the pcp_node_info using raw credentials and
foreign server.

See the below example

postgres=# create foreign data wrapper dummy;
CREATE FOREIGN DATA WRAPPER
postgres=# create server pcp_server foreign data wrapper dummy options(host
'localhost', port '9891', user 'postgres', password 'postgres');
CREATE SERVER
postgres=# create user mapping for postgres server pcp_server options (user
'postgres', password 'postgres');
CREATE USER MAPPING
postgres=# SELECT * FROM pgpool.pcp_node_info(0, 'pcp_server');
   host    | port |      status       | weight
-----------+------+-------------------+--------
 127.0.0.1 | 5432 | Connection in use |      0
(1 row)


Regards
Muhammad Usama

On Sun, Mar 13, 2016 at 2:55 PM, Avi Weinberg <AviW at gilat.com> wrote:

> Hi All,
>
>
>
> I'm using pgpool 3.5 and I have two postgres machines and two pgpool
> machines – total 4 servers.
>
>
>
> I would like to know if pgpool_adm is installed on the postgres machines
> or the pgpool machine.  I assume that if it is installed on the pgpool
> machine I will have to install postgres on those machines as well right?
>
> Currently I get an error "server localhost does not exist" when installing
> it on the postgres machine.
>
>
>
>    CREATE SCHEMA pgpool;
>    CREATE EXTENSION pgpool_adm WITH SCHEMA pgpool ;
>    SELECT * FROM pgpool.pcp_node_info(0, 'localhost');
>
> Thanks
>
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20160315/ffc7c898/attachment.html>


More information about the pgpool-general mailing list