pg_autoctl : Get list of all formations #1080
Answered
by
PatrickBzh
PatrickBzh
asked this question in
Q&A
|
Hello, Each formation is composed of two PostgreSQL nodes. I haven't found a way to list all the formations of a monitor using pg_autoctl. The only workaround I've found is to query the monitor's pg_auto_failover database directly, but I don't really like this idea [postgres@vpostgres-test3-ope:~ 02:51 PM]$ psql -p 3000 pg_auto_failover -c "select formationid, nodename, nodeport, goalstate, reportedstate, reportedpgisrunning, health from pgautofailover.node;"
formationid | nodename | nodeport | goalstate | reportedstate | reportedpgisrunning | health
-------------+-----------------------------+----------+-----------+---------------+---------------------+--------
14-isi | 14-isi-vpostgres-test1-ope | 8433 | primary | primary | t | 1
14-isi | 14-isi-vpostgres-test2-ope | 8433 | secondary | secondary | t | 1
17-test | 17-test-vpostgres-test1-ope | 8432 | primary | primary | t | 1
17-test | 17-test-vpostgres-test2-ope | 8432 | secondary | secondary | t | 1
(4 rows)Is there a pg_autoctl way to get a list of all formations for a specified monitor instance ? Many thanks !! Patrick. |
Answered by
PatrickBzh
Apr 9, 2025
Replies: 1 comment 2 replies
|
I've found the it should be a good starting point for shell script usages. |
2 replies
Answer selected by
PatrickBzh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've found the
pg_autoctl show uricommand.. Filtering out default & monitor rows is quite a fine/fast solutionit should be a good starting point for shell script usages.