I have a PostreSQL cluster where I have a master and a slave. I have seen that pgx/pgxpoll
supports simultaneous connection to multiple hosts, but I do not understand how requests will be executed then. Can pgx understand where the master is? (I didn’t find that he could do that.) And will pgx work at all if I have a master and a slave, and only readonly requests can be executed on the slave.
Please help me figure out the issue
I had an idea that the requests would be scattered round robin, but I did not find confirmation. And I don’t know what will happen if the write request gets to the slave.
I understand roughly how you can write a wrapper around a pool so that it supports such an architecture, but I don’t understand whether it is necessary or not