Feature request: make cluster_name GUC useful for psql prompts

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Feature request: make cluster_name GUC useful for psql prompts
Дата
Msg-id CAEfWYyyeN3x+6qFJaCv64wpKw3SbwZ7XEdW_nhU3yjiuYyuNFA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Feature request: make cluster_name GUC useful for psql prompts  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
It's great that 9.5 has the new cluster_name variable as an available GUC.

It would be even better to make that GUC available for use in psql prompting escape sequences.

Prompting via sequences utilizing %M, %m and %> means the same cluster could be identified numerous ways (local, 127.0.0.1, 10.1.2.3, localhost, myserver.example.com, myserver, etc.) which is further exacerbated when pooling or port-forwarding is in play.

In the inverse case, when logging into a multiple servers and running psql, all the prompts might just say "local" despite all being different clusters.

Adding an escape sequence that references cluster_name would enable prompts to identify the cluster in a manner that is both consistent and distinct regardless of access path.

Potential issues/improvements:

What should the escape-sequence display if cluster_name is not set or the cluster is a pre-9.5 version. %M? %m?

In future server versions should there be a default for cluster_name if it is not set? If so, what should it be? Would the server canonical hostname + listen-port be reasonable?

Cheers,
Steve

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Initial release notes created for 9.6
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: Initial release notes created for 9.6