What should be the corrosponding version of PostgreSQL for using it with Redmine version 2.6.1?
I am totally new to redmine and I have to use the version of 2.6.1 and the constraint is to use PostgreSQL as database. So I would want to know what version of Postgres would work the best with this old release of redmine.
You shouldn't be running that old of Redmine. That said if it is the requirement it is the requirement.
You should try with PostgreSQL v12 first. If it works, then you have nothing to worry about for 4 years (in terms of community support). If you can't get v12 to work, then 10 or 11 should suffice. However, stay away from the 9.x series due to EOL issues over the next couple of years.
I don't think Rails 3 + pg 0.17.1 support even PostgreSQL v10. You should really consider an upgrade.