Re: [HACKERS] Improvements in psql hooks for variables - Mailing list pgsql-hackers

From Daniel Verite
Subject Re: [HACKERS] Improvements in psql hooks for variables
Date
Msg-id 1dee8049-2bb7-428c-bef4-46745722c61e@manitou-mail.org
Whole thread Raw
In response to Re: [HACKERS] Improvements in psql hooks for variables  (Ashutosh Sharma <ashu.coek88@gmail.com>)
List 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 by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] [PATCH] Fix minor race in commit_ts SLRU truncation vslookups
Next
From: Jorge Solórzano
Date:
Subject: Re: [HACKERS] SEGFAULT in HEAD with replication