diff options
Diffstat (limited to 'src/bin/psql/help.c')
-rw-r--r-- | src/bin/psql/help.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 6bac9e47fd7..6fc4ebab1e8 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -623,16 +623,23 @@ helpSQL(const char *topic, unsigned short int pager) strcmp(topic, "*") == 0) { PQExpBufferData buffer; + char *url; initPQExpBuffer(&buffer); QL_HELP[i].syntaxfunc(&buffer); help_found = true; + url = psprintf("https://www.postgresql.org/docs/%s/%s.html", + strstr(PG_VERSION, "devel") ? "devel" : PG_MAJORVERSION, + QL_HELP[i].docbook_id); fprintf(output, _("Command: %s\n" "Description: %s\n" - "Syntax:\n%s\n\n"), + "Syntax:\n%s\n\n" + "URL: %s\n\n"), QL_HELP[i].cmd, _(QL_HELP[i].help), - buffer.data); + buffer.data, + url); + free(url); /* If we have an exact match, exit. Fixes \h SELECT */ if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0) break; |