Reference
This part contains reference information for the Pgpool-II.
The reference entries are also available as traditional
man pages.
Server commands
This part contains reference information for server
commands. Currently only pgpool falls into
this category.
&pgpool;
PCP commands
This part contains reference information for PCP commands.
PCP commands are UNIX commands which manipulate pgpool-II via
the network. Please note that the parameter format for all
PCP commands has been changed since Pgpool-II
3.5.
PCP connection authentication
PCP user names and passwords must be declared in
pcp.conf
in $prefix/etc directory
(see to know to create
the file). option can be used when
starting
Pgpool-II
if pcp.conf is placed somewhere else.
PCP password file
The file .pcppass.pcppass in a user's home
directory or the file referenced by environment variable
PCPPASSFILE PCPPASSFILE can contain passwords to be used if no password has
been specified for the pcp connection (In Pgpool-II 4.4 or before, -w/--no-password option is needed).
See for more details.
This file should contain lines of the following format:
hostname:port:username:password
(You can add a reminder comment to the file by copying the line
above and preceding it with #.) Each of the first three fields
can be a literal value, or *, which matches anything. The password
field from the first line that matches the current connection
parameters will be used. (Therefore, put more-specific entries
first when you are using wildcards.) If an entry needs to contain
: or \, escape this character with \. The hostname field is matched
to the host connection parameter if that is specified, if the host
parameter is not given then the host name localhost
is searched for. The host name localhost is also
searched for when the connection is a Unix domain socket connection
and the host parameter matches the default pcp socket directory path.
The permissions on .pcppass must disallow any access to world or
group; achieve this by the command chmod 0600 ~/.pcppass. If the
permissions are less strict than this, the file will be
ignored.
&pcpCommonOptions;
&pcpNodeCount;
&pcpNodeInfo;
&pcpHealthCheckStats;
&pcpWatchdogInfo;
&pcpProcCount;
&pcpProcInfo;
&pcpPoolStatus;
&pcpDetachNode;
&pcpAttachNode;
&pcpPromoteNode;
&pcpStopPgpool;
&pcpReloadConfig;
&pcpRecoveryNode;
&pcpLogRotate;
&pcpInvalidateCache;
Other commands
This part contains reference information for various Pgpool-II commands.
&pgMd5;
&pgEnc;
&pgproto;
&pgpoolSetup;
&watchdogSetup;
&wdCli;
SQL type commands
This part contains reference information for various SQL type
Pgpool-II commands. These commands
can be issued inside the SQL session using the
standard PostgreSQL client
like psql. They are not forwarded to the
backend DB: instead they are processed
by Pgpool-II server. Please note
that SQL type commands cannot be used in extended query
mode. You will get parse errors
from PostgreSQL.
&pgpoolShow
&pgpoolSet
&pgpoolSetCache
&pgpoolReset
&showPoolStatus
&showPoolNodes
&showPoolProcesses
&showPoolPools
&showPoolVersion
&showPoolCache
&showPoolHealthCheckStats
&showPoolBackendStats
pgpool_adm extensionpgpool_adm is a set of extensions to allow
SQL access to (actually, pcp
libraries). It uses foreign data wrapper as shown in the
diagram below.
How pgpool_adm works
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 forwards 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 (4).
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 extracted from $HOME/.pcppass.
Installing pgpool_adm
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
&pgpoolAdmPcpNodeInfo
&pgpoolAdmPcpHealthCheckStats
&pgpoolAdmPcpPoolStatus
&pgpoolAdmPcpNodeCount
&pgpoolAdmPcpAttachNode
&pgpoolAdmPcpDetachNode
&pgpoolAdmPcpProcInfo