Skip to content

Commit e7873bd

Browse files
author
Commitfest Bot
committed
[CF 5498] v3 - Adding extension default version to \dx
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5498 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/[email protected] Author(s): Magnus Hagander, Jelte Fennema-Nio
2 parents e215166 + b608d27 commit e7873bd

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/bin/psql/describe.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -6188,13 +6188,16 @@ listExtensions(const char *pattern)
61886188
initPQExpBuffer(&buf);
61896189
printfPQExpBuffer(&buf,
61906190
"SELECT e.extname AS \"%s\", "
6191-
"e.extversion AS \"%s\", n.nspname AS \"%s\", c.description AS \"%s\"\n"
6191+
"e.extversion AS \"%s\", ae.default_version AS \"%s\","
6192+
"n.nspname AS \"%s\", d.description AS \"%s\"\n"
61926193
"FROM pg_catalog.pg_extension e "
61936194
"LEFT JOIN pg_catalog.pg_namespace n ON n.oid = e.extnamespace "
6194-
"LEFT JOIN pg_catalog.pg_description c ON c.objoid = e.oid "
6195-
"AND c.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
6195+
"LEFT JOIN pg_catalog.pg_description d ON d.objoid = e.oid "
6196+
"LEFT JOIN pg_catalog.pg_available_extensions() ae(name, default_version, comment) ON ae.name = e.extname "
6197+
"AND d.classoid = 'pg_catalog.pg_extension'::pg_catalog.regclass\n",
61966198
gettext_noop("Name"),
61976199
gettext_noop("Version"),
6200+
gettext_noop("Default version"),
61986201
gettext_noop("Schema"),
61996202
gettext_noop("Description"));
62006203

src/test/regress/expected/psql.out

+3-3
Original file line numberDiff line numberDiff line change
@@ -6460,9 +6460,9 @@ List of schemas
64606460
(0 rows)
64616461

64626462
\dx "no.such.installed.extension"
6463-
List of installed extensions
6464-
Name | Version | Schema | Description
6465-
------+---------+--------+-------------
6463+
List of installed extensions
6464+
Name | Version | Default version | Schema | Description
6465+
------+---------+-----------------+--------+-------------
64666466
(0 rows)
64676467

64686468
\dX "no.such.extended.statistics"

0 commit comments

Comments
 (0)