Skip to content

Commit

Permalink
[pg15] fix: remove postgres documentation URLs from psql \help output
Browse files Browse the repository at this point in the history
Summary:
Remove URLs linking to postgres documentation (introduced by upstream PG commit
27f3dea64833d68c1fa08c1e5d26176a579f69c8) from psql \help output.

Since YB introduces additional syntax, disabling URLs across the board simplifies
the help output, avoiding potential confusion caused by URLs pointing to
non-existent/wrong documentation.

Test Plan:
for _ in {1..10}; do grep -E "TestPgRegressTablegroup|TestPgRegressProfile" pg15_tests/passing_tests.tsv; done | pg15_tests/run_tests.sh

Reviewers: jason

Reviewed By: jason

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D36505
  • Loading branch information
fizaaluthra committed Aug 1, 2024
1 parent c46bff3 commit da70470
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
17 changes: 9 additions & 8 deletions src/postgres/src/bin/psql/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,23 +702,24 @@ helpSQL(const char *topic, unsigned short int pager)
strcmp(topic, "*") == 0)
{
PQExpBufferData buffer;
char *url;
/* YB: exclude links to postgres documentation. */
/* char *url; */

initPQExpBuffer(&buffer);
QL_HELP[i].syntaxfunc(&buffer);
url = psprintf("https://www.postgresql.org/docs/%s/%s.html",
/* url = psprintf("https://www.postgresql.org/docs/%s/%s.html",
strstr(PG_VERSION, "devel") ? "devel" : PG_MAJORVERSION,
QL_HELP[i].docbook_id);
QL_HELP[i].docbook_id); */
/* # of newlines in format must match constant above! */
fprintf(output, _("Command: %s\n"
"Description: %s\n"
"Syntax:\n%s\n\n"
"URL: %s\n\n"),
"Syntax:\n%s\n\n"),
/* "URL: %s\n\n"), */
QL_HELP[i].cmd,
_(QL_HELP[i].help),
buffer.data,
url);
free(url);
buffer.data);
/* url); */
/* free(url); */
termPQExpBuffer(&buffer);

/* If we have an exact match, exit. Fixes \h SELECT */
Expand Down
8 changes: 0 additions & 8 deletions src/postgres/src/test/regress/expected/yb_profile.out
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ CREATE PROFILE profile_name LIMIT
FAILED_LOGIN_ATTEMPTS number;
[PASSWORD_LOCK_TIME days];

URL: https://www.postgresql.org/docs/15/sql-createprofile.html

--
-- Test \h DROP PROFILE
--
Expand All @@ -94,8 +92,6 @@ Description: remove a login profile
Syntax:
DROP PROFILE profile_name;

URL: https://www.postgresql.org/docs/15/sql-dropprofile.html

--
-- Test \h ALTER USER
--
Expand Down Expand Up @@ -134,8 +130,6 @@ where role_specification can be:
| CURRENT_USER
| SESSION_USER

URL: https://www.postgresql.org/docs/15/sql-alteruser.html

--
-- Test \h ALTER ROLE
--
Expand Down Expand Up @@ -173,5 +167,3 @@ where role_specification can be:
| CURRENT_ROLE
| CURRENT_USER
| SESSION_USER

URL: https://www.postgresql.org/docs/15/sql-alterrole.html
6 changes: 0 additions & 6 deletions src/postgres/src/test/regress/expected/yb_tablegroup.out
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,19 @@ Description: define a new tablegroup
Syntax:
CREATE TABLEGROUP tablegroup_name

URL: https://www.postgresql.org/docs/15/sql-createtablegroup.html

\h ALTER TABLEGROUP
Command: ALTER TABLEGROUP
Description: change the definition of a tablegroup
Syntax:
ALTER TABLEGROUP name RENAME TO new_name
ALTER TABLEGROUP name OWNER TO { new_owner | CURRENT_USER | SESSION_USER }

URL: https://www.postgresql.org/docs/15/sql-altertablegroup.html

\h DROP TABLEGROUP
Command: DROP TABLEGROUP
Description: remove a tablegroup
Syntax:
DROP TABLEGROUP name

URL: https://www.postgresql.org/docs/15/sql-droptablegroup.html

--
-- pg_catalog alterations. Validate columns of pg_yb_tablegroup and oids.
--
Expand Down

0 comments on commit da70470

Please sign in to comment.