@swathivarkala Yes, i faced this issue in last couple of months at 2 sites. Doing the above steps that i shared with Gift, had fixed this problem at those sites.
Basically the bahmni installation sets archiving to true and the archive_command something like this
archive_command = 'pgbackrest --stanza=bahmni-postgres archive-push %p' # command to use to archive a logfile segment
However, i think if pgbackrest (bahmni postgres backup tools) are not installed, this archive commands fail and so postgres keeps accumulating these pg_xlogs.
(Most implementations aren’t using these backup tools. honestly, i have not yet spent enough time figuring how using them would solve the basic problem of incremental backups for which they were introduced and pg_dump for all other cases is just fine)
I was going to share it here, for anyone facing the problem, but good that Gift shared sooner than I did. We could add this to known issues in Bahmni wiki, may be.
Also, may be the installation should set archiving on and archive command based on some parameters in setup.yml, because the fix above persists only in between installations and recurs on upgrades.