Re: proposal: alternative psql commands quit and exit

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: alternative psql commands quit and exit
Date: 2017-12-13 01:26:40
Message-ID: CAMsr+YE_tu88crPvjNCdpVHA_ud7PHSdHAFFu3rnM1HAK7KmXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12 December 2017 at 23:02, Geoff Winkless <pgsqladmin(at)geoff(dot)dj> wrote:

> I wouldn't exactly say -1 but it's a "meh" from me.
>
> On 8 December 2017 at 13:57, Daniel Vérité" <daniel(at)manitou-mail(dot)org>
> wrote:
> > "How to exit from PostgreSQL command line utility: psql"
> >
> > now at 430k views and 1368 upvotes.
>
> There is also stackexchange question with 51000 views that asks how to
> start the postgresql client. Should we rename psql to mysql to help
> new users too?
>

Frankly, that's a legit question and I don't think it's one we should be
mocking. The application is "PostgreSQL" and it's not at all surprising
that people don't find it immediately obvious that the client is "psql".
Yes, we have a manual, but if they have to refer to it for something that
trivial then that's an opportunity for us to improve UX.

Especially since "postgres" isn't on the PATH in most installs.

I'd suggest having 'postgres' print a help msg suggesting "the client
program is psql"... but that does no good if you get

$ postgres
bash: postgres: command not found...
Install package 'postgresql-server' to provide command 'postgres'? [N/y]

(then there's the Ubuntu versions that "helpfully" suggest you might want
to install postgres-xc. Seriously. WTF, people.)

Ctrl-D works almost everywhere.

... if you are used to using a command line interface and know it even
exists.

It takes 2 seconds to find the answer
> and there are going to be many other things you have to find out if
> you're coming at PostgreSQL from a different DB.
>

Yep. But that doesn't mean we should make the simple things harder than
they need to be. Why have \? at all!

> As others have pointed out, there are _far_ more frustrating things
> (like the lack of SHOW CREATE [TABLE|etc]... support in the backend)
>

I cannot overemphasise the importance of that one. I don't care that much
about the spelling, tbh, but the fact that table metadata formatting and
display is done wholly client-side and cannot be used in applications is
absolutely horrid, and a real wart in the system. If we had the server-side
functionality then some special case HINTs in error messages for common
systems would be reasonable enough.

Frankly that's probably a good idea anyway, adding a specific errhint. But
it's really a separate topic.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-12-13 01:32:32 Re: Parallel Index Scan vs BTP_DELETED and BTP_HALF_DEAD
Previous Message Haribabu Kommi 2017-12-13 01:09:20 Re: [HACKERS] SERIALIZABLE with parallel query