Re: [HACKERS] Improvements in psql hooks for variables

Поиск
Список
Период
Сортировка
От Daniel Verite
Тема Re: [HACKERS] Improvements in psql hooks for variables
Дата
Msg-id 1dee8049-2bb7-428c-bef4-46745722c61e@manitou-mail.org
обсуждение исходный текст
Ответ на Re: [HACKERS] Improvements in psql hooks for variables  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Список pgsql-hackers
    Ashutosh Sharma wrote:

> postgres=# \echo :ENCODING
> UTF8
> postgres=# \set ENCODING xyz
> postgres=# \echo :ENCODING
> xyz
>
> I think currently we are not even showing what are the different valid
> encoding names to the end users like we show it for other built-in
> variables
> VERBOSITY, ECHO etc. I mean if i run '\set VERBOSITY' followed by tab
> command it does show me the valid values for VERBOSITY but not for
> ENCODING.

Setting ENCODING has no effect, like DBNAME, USER, HOST and PORT.
In a way, it's a read-only variable that's here to inform the user,
not as a means to change the encoding (\encoding does that and
has proper support for tab completion)

What we could do as of this patch is emit an error when we try
to change ENCODING, with a hook returning false and
a proper error message hinting to \encoding.

I'm working on adding such messages to other variables.

Best regards,
--
Daniel Vérité
PostgreSQL-powered mailer: http://www.manitou-mail.org
Twitter: @DanielVerite



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vslookups
Следующее
От: Jorge Solórzano
Дата:
Сообщение: Re: [HACKERS] SEGFAULT in HEAD with replication