pgpool_adm is a set of extensions to allow SQL access to Reference II, PCP commands (actually, pcp libraries). It uses foreign data wrapper as shown in the diagram below.
It is possible to call the functions from either via pgpool-II (1) or via PostgreSQL (2). In case (1), Pgpool-II accepts query from user (1), then forward to PostgreSQL (3). PostgreSQL connects to Pgpool-II (5) and Pgpool-II reply back to PostgreSQL with the result (3). PostgreSQL returns the result to Pgpool-II (5) and Pgpool-II fowards the data to the user (6).
In case (2), PostgreSQL accepts query from user (2). PostgreSQL connects to Pgpool-II (5) and Pgpool-II reply back to PostgreSQL with the result (3). PostgreSQL replies back the data to the user (6).
There are two forms to call pgpool_adm functions: first form accepts Pgpool-II host name (or IP address), pcp port number, pcp user name, its password and another parameters.
In the second form, Pgpool-II server name is required. The server name must be already defined using "CREATE FOREIGN SERVER" command of PostgreSQL. The pcp port number is hard coded as 9898, the pcp user name is assumes to be same as caller's PostgreSQL user name. password is extraced from $HOME/.pcppass.
pgpool_adm is an extension and should be installed on all PostgreSQL servers.
$ cd src/sql/pgpool_adm $ make $ make install
Then issue following SQL command for every database you want to access.
$ psql ... $ CREATE EXTENSION pgpool_adm