Thread: SSL indicator in psql prompt

SSL indicator in psql prompt

From
Peter Eisentraut
Date:
I like how browsers show a little lock in the address bar depending on
whether SSL is in use.  This could be useful in psql as well.  Here is a
prototype patch.

Example:

Put this in .psqlrc:

\set PROMPT1 '%s%/%R%# '

$ psql test
psql (9.6devel)
Type "help" for help.

🔒test=#

Without SSL:

🃏test=#

Comments?

Attachment

Re: SSL indicator in psql prompt

From
"Shulgin, Oleksandr"
Date:
On Fri, Apr 1, 2016 at 2:52 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
I like how browsers show a little lock in the address bar depending on
whether SSL is in use.  This could be useful in psql as well.  Here is a
prototype patch.

Example:

Put this in .psqlrc:

\set PROMPT1 '%s%/%R%# '

$ psql test
psql (9.6devel)
Type "help" for help.

🔒test=#

Without SSL:

🃏test=#

Comments?

Sounds reasonable.  What is the meaning of the latter symbol?

--
Alex

Re: SSL indicator in psql prompt

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> I like how browsers show a little lock in the address bar depending on
> whether SSL is in use.  This could be useful in psql as well.  Here is a
> prototype patch.
> Comments?

-1 on the hard-coded UTF8, even with the encoding check (which I don't
think is terribly trustworthy).  How about defining it in a way that
lets/makes the user provide the character(s) to print?
        regards, tom lane



Re: SSL indicator in psql prompt

From
Robert Haas
Date:
On Fri, Apr 1, 2016 at 10:15 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> I like how browsers show a little lock in the address bar depending on
>> whether SSL is in use.  This could be useful in psql as well.  Here is a
>> prototype patch.
>> Comments?
>
> -1 on the hard-coded UTF8, even with the encoding check (which I don't
> think is terribly trustworthy).  How about defining it in a way that
> lets/makes the user provide the character(s) to print?

I think you have been trolled.  Note the date.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: SSL indicator in psql prompt

From
"Shulgin, Oleksandr"
Date:
<p dir="ltr">On Apr 4, 2016 17:54, "Robert Haas" <<a
href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>>wrote:<br /> ><br /> > On Fri, Apr 1, 2016 at
10:15AM, Tom Lane <<a href="mailto:tgl@sss.pgh.pa.us">tgl@sss.pgh.pa.us</a>> wrote:<br /> > > Peter
Eisentraut<<a href="mailto:peter_e@gmx.net">peter_e@gmx.net</a>> writes:<br /> > >> I like how browsers
showa little lock in the address bar depending on<br /> > >> whether SSL is in use.  This could be useful in
psqlas well.  Here is a<br /> > >> prototype patch.<br /> > >> Comments?<br /> > ><br /> >
>-1 on the hard-coded UTF8, even with the encoding check (which I don't<br /> > > think is terribly
trustworthy). How about defining it in a way that<br /> > > lets/makes the user provide the character(s) to
print?<br/> ><br /> > I think you have been trolled.  Note the date.<p dir="ltr">Are you trying to say that this
featureis in your opinion useless?<p dir="ltr">Even if that's an April Fools patch, I don't thiy it is entirely out of
scope.:-) <p dir="ltr">--<br /> Alex 

Re: SSL indicator in psql prompt

From
Robert Haas
Date:
On Mon, Apr 4, 2016 at 12:07 PM, Shulgin, Oleksandr
<oleksandr.shulgin@zalando.de> wrote:
> On Apr 4, 2016 17:54, "Robert Haas" <robertmhaas@gmail.com> wrote:
>>
>> On Fri, Apr 1, 2016 at 10:15 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > Peter Eisentraut <peter_e@gmx.net> writes:
>> >> I like how browsers show a little lock in the address bar depending on
>> >> whether SSL is in use.  This could be useful in psql as well.  Here is
>> >> a
>> >> prototype patch.
>> >> Comments?
>> >
>> > -1 on the hard-coded UTF8, even with the encoding check (which I don't
>> > think is terribly trustworthy).  How about defining it in a way that
>> > lets/makes the user provide the character(s) to print?
>>
>> I think you have been trolled.  Note the date.
>
> Are you trying to say that this feature is in your opinion useless?

Well, what I was trying to say is that I don't think the proposal was
100% serious.  However, I also don't think it's particularly useful.
I am not a big fan of cluttering up the psql command line with random
Unicode glyphs.  It's easy enough to find out whether you've got an
SSL connection if you want to, with \conninfo.  I don't think it needs
to be part of every prompt.

YMMV, of course.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company