PGPOOL_AD...OL_STATUS(3)

πŸ’– PGPOOL_AD...OL_STATUS(3) πŸ’–

okay bestie, so this is a page from the pgpool-II 4.7.2 documentation and it's all about one very specific little function. she's lowkey iconic, she's a foreign-server function in the pgpool_adm family, and no cap, she's gonna hand you your pgpool.conf settings on a silver platter ✨


🌸 NAME 🌸

pgpool_adm_pcp_pool_status β€” a function to retrieves parameters in pgpool.conf.

fr fr, that's literally her whole job and she does it flawlessly πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

she comes in two flavours, bestie, and both of them returns setof record πŸ‘‘

pcp_pool_status returns setof record(text host, integer port,
                                     text username, text password,
                                     out item text, out value text,
                                     out description text);

pcp_pool_status returns setof record(text pcp_server, out item text,
                                     out value text,
                                     out description text);

so you either hand her the whole host / port / username / password combo, or you just point her at a pcp_server. either way she pops back item, value, and description columns, periodt πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

pcp_pool_status retrieves parameters in pgpool.conf.

that's it. that's the mission. she's reading the config and reading it back to you, no drama, no crumbs left behind 🌈


✨ ARGUMENTS ✨

  • pcp_server β€” the foreign server name for pcp server. basically the nickname you gave your pcp server so you don't gotta spell everything out every single time 🫢
  • Other arguments β€” see pcp_common_options(1). go check the girlies over there, they got the full rundown πŸ’–

πŸ“ EXAMPLE πŸ“

here's what it looks like in the wild, and honestly? it's giving production-ready 😭

test=# SELECT * FROM pcp_pool_status(host => 'localhost', port => 11001, username => 't-ishii', password => 't-ishii') WHERE item ~ 'backend.*0';
item           |                     value                      |          description
-------------------------+------------------------------------------------+-------------------------------
backend_hostname0       | /tmp                                           | backend #0 hostname
backend_port0           | 11002                                          | backend #0 port number
backend_weight0         | 0.500000                                       | weight of backend #0
backend_data_directory0 | /home/t-ishii/work/pgpool-II/current/aaa/data0 | data directory for backend #0
backend_status0         | 2                                              | status of backend #0
backend_flag0           | ALLOW_TO_FAILOVER                              | backend #0 flag
(6 rows)

look at those six rows. backend_hostname0, backend_port0, backend_weight0, backend_data_directory0, backend_status0, backend_flag0 β€” all of them, all accounted for, all serving looks πŸ”₯ and yes, the WHERE item ~ 'backend.*0' regex is doing the heavy lifting. iykyk πŸ’€


bestie reminder: you never gotta guess what she's gonna return β€” the columns are locked in as item, value, and description, every single time πŸ‘‘

okay and for the cute sign-off: this whole unhinged love letter is from pgpool-II 4.7.2, dated 2023, and it lives under the manual page name PGPOOL_AD...OL_STATUS(3). mwah, go query something, ily πŸ§šπŸ’–

πŸ“¦ where this page comes from