Recently I put a proposal to support 'prefer-read' parameter in target_session_attrs in libpq. Now I updated the patch with adding content in the sgml and regression test case.
Some people may have noticed there is already another patch (https://commitfest.postgresql.org/15/1148/ ) which looks similar with this. But I would say this patch is more complex than my proposal.
It is better separate these 2 patches to consider.
I also feel prefer-read and read-only options needs to take as two different options.
prefer-read is simple to support than read-only.
Here I attached an updated patch that is rebased to the latest master and also