Hello.
Suggested patch introduces an %r substitution in psql's prompt. This
substitution allows to display whether user is connected to master or
replica right in a prompt.
Usage example:
```
$ cat ~/.psqlrc
\set PROMPT1 '%p (%r) =# '
$ psql -p 5432
psql (9.6beta4)
Type "help" for help.
20638 (m) =# \q
$ psql -p 5433
psql (9.6beta4)
Type "help" for help.
20647 (r) =# \q
```
Currently I'm working on some functionality involving master-slave
replication. Sometimes I accidentally connect to a master instead of
replica and vice versa. Presence of functionality described above would
make my work much more convenient.
Hopefully there are other people in PostgreSQL community who feel that
way.
--
Best regards,
Aleksander Alekseev