Restructure libpq code to remove some duplicity

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: b438e7e7a1c58e0c20b5f46e73cbd713e8033c69
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2019-09-10T15:14:24Z
Releases: 13.0
Restructure libpq code to remove some duplicity

There was some duplicate code to run SHOW transaction_read_only to
determine whether the server is read-write or read-only.  Reduce it by
adding another state to the state machine.

Author: Hari Babu Kommi
Reviewed-by: Takayuki Tsunakawa, Álvaro Herrera
Discussion: https://postgr.es/m/CAJrrPGe_qgdbbN+yBgEVpd+YLHXXjTruzk6RmTMhqrFig+32ag@mail.gmail.com

Files

PathChange+/−
src/interfaces/libpq/fe-connect.c modified +31 −54
src/interfaces/libpq/libpq-fe.h modified +2 −1

Discussion