pgsql-hackers
❮
Idea Feedback: psql \h misses -> Offers Links?
- Jump to comment-1Kirk Wolak<wolakk@gmail.com>Apr 17, 2024, 5:47 PM UTC
great feature.Hackers, I often use the ctrl-click on the link after getting help in psql. A
Challenge, when there is no help, you don't get any link.
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q={TOKEN}My thought process is to add a default response that would take them to
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=%7BTOKEN%7D
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting
This is Question 1: Do others see the potential value here?To me, this is a huge step in helping me get to the docs.
Question 2: What if we allowed the users to set some extra link Templates
using \pset??
\pset helpassistlink_1 = https://www.google.com/search?q={token}'
\pset helpassistlink_2 = '
https://wiki.postgresql.org/index.php?title=Special%3ASearch&search={token}&go=Go
https://wiki.postgresql.org/index.php?title=Special%3ASearch&search=%7Btoken%7D&go=Go
'
Such that the output, this time would be:
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting
https://www.google.com/search?q=current_setting
https://wiki.postgresql.org/index.php?title=Special%3ASearch&search=current_setting&go=Go
This Latter feature, I would consider applying to even successful searches?
[Based on Feedback here]
Thoughts?- Jump to comment-1Euler Taveira<euler@eulerto.com>Apr 19, 2024, 2:14 PM UTCOn 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 tohttps://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q={TOKEN} https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=%7BTOKEN%7D
That's because current_setting is a function. Help says:
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.
postgres=# \?
.
.
.
Help
It is just for SQL commands.\? [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 commandshttps://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting
Yes. However, I expect an exact and direct answer. There will be cases that the
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?
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 helpassistlink_1 = https://www.google.com/search?q={token} https://www.google.com/search?q=%7Btoken%7D'
That's a different idea. Are you proposing to provide URLs if this psql
\pset helpassistlink_2 = 'https://wiki.postgresql.org/index.php?title=Special%3ASearch&search={token}&go=Go https://wiki.postgresql.org/index.php?title=Special%3ASearch&search=%7Btoken%7D&go=Go'
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.
[1] https://www.postgresql.org/docs/current/bookindex.html
--
Euler Taveira
EDB https://www.enterprisedb.com/ - Jump to comment-1Peter Eisentraut<peter@eisentraut.org>Apr 18, 2024, 6:37 PM UTCOn 17.04.24 19:47, Kirk Wolak wrote:
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting > https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting
One problem is that this search URL does not actually produce any useful information about current_setting.- Jump to comment-1Kirk Wolak<wolakk@gmail.com>Apr 18, 2024, 9:29 PM UTCOn Thu, Apr 18, 2024 at 2:37 PM Peter Eisentraut <peter@eisentraut.org>
wrote:On 17.04.24 19:47, Kirk Wolak wrote:
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_settinghttps://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting
weak? That's the full name of an existing function, and it's in the index.
One problem is that this search URL does not actually produce any useful
information about current_setting.
I see what you mean, but doesn't that imply our web search feature is
But it cannot be found if searched from the website?- Jump to comment-1Peter Eisentraut<peter@eisentraut.org>Apr 19, 2024, 8:45 AM UTCOn 18.04.24 23:29, Kirk Wolak wrote:
On Thu, Apr 18, 2024 at 2:37 PM Peter Eisentraut <peter@eisentraut.org > <mailto:peter@eisentraut.org>> wrote:
On 17.04.24 19:47, Kirk Wolak wrote:
Example:
\h current_setting
No help available for "current_setting".
Try \h with no arguments to see available help.
https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_settinghttps://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting https://www.postgresql.org/search/?u=%2Fdocs%2F16%2F&q=current_setting>
One problem is that this search URL does not actually produce any
useful
information about current_setting.I see what you mean, but doesn't that imply our web search feature is > weak? That's the full name of an existing function, and it's in the > index. But it cannot be found if searched from the website?
Maybe it's weak, or maybe we are using it wrong, I don't know.
\h has always been (a) local help, and (b) help specifically about SQL commands. If we are going to vastly expand the scope, we need to think it through more thoroughly. I could see some kind of \onlinehelp command, or maybe even redesigning \h altogether.
Also, as you say, the function is in the documentation index, so there should be a deterministic way to go directly to exactly the target destination. Maybe the full-text search functionality of the web site is the wrong interface for that.