Re: Idea Feedback: psql \h misses -> Offers Links? - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: Idea Feedback: psql \h misses -> Offers Links?
Date
Msg-id e3deb4ca-0835-4e35-9abc-753e7b6dfc0c@app.fastmail.com
Whole thread Raw
In response to Idea Feedback: psql \h misses -> Offers Links?  (Kirk Wolak <wolakk@gmail.com>)
Responses Re: Idea Feedback: psql \h misses -> Offers Links?
List pgsql-hackers
On Wed, Apr 17, 2024, at 2:47 PM, Kirk Wolak wrote:
  I often use the ctrl-click on the link after getting help in psql.  A great feature.

Challenge, when there is no help, you don't get any link.

  My thought process is to add a default response that would take them to

Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.

That's because current_setting is a function. Help says:

postgres=# \?
.
.
.
Help
  \? [commands]          show help on backslash commands
  \? options             show help on psql command-line options
  \? variables           show help on special variables
  \h [NAME]              help on syntax of SQL commands, * for all commands

It is just for SQL commands.


  To me, this is a huge step in helping me get to the docs.

This is Question 1: Do others see the potential value here?

Yes. However, I expect an exact and direct answer. There will be cases that the
first result is not the one you are looking for. (You are expecting the
function or parameter description but other page is on the top because it is
more relevant.) The referred URL does not point you to the direct link.
Instead, you have to click again to be able to check the content.

Question 2: What if we allowed the users to set some extra link Templates using \pset??

\pset help_assist_link_1 =  https://www.google.com/search?q={token}'

That's a different idea. Are you proposing to provide URLs if this psql
variable is set and it doesn't find an entry (say \h foo)? I'm not sure if it
is a good idea to allow third-party URLs (even if it is configurable).

IMO we should expand \h to list documentation references for functions and GUCs
using SGML files. We already did it for SQL commands. Another broader idea is
to build an inverted index similar to what Index [1] provides. The main problem
with this approach is to create a dependency between documentation build and
psql. Maybe there is a reasonable way to obtain the links for each term.




--
Euler Taveira

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible to exclude a database from loading a shared_preload_libraries module?
Next
From: Tomas Vondra
Date:
Subject: Re: brininsert optimization opportunity