Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit978f38c

Browse files
committed
Add information about access method for partitioned relations in \dP+
Since374c7a2, it is possible to set a table AM on a partitionedtable. This information was showing up already in psql with \d+, while\dP+ provided no information.This commit extends \dP+ to show the access method used by a partitionedtable or index, if set.Author: Justin PryzbyDiscussion:https://postgr.es/m/ZkyivySXnbvOogZz@pryzbyj2023
1 parentedadeb0 commit978f38c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎src/bin/psql/describe.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4113,7 +4113,7 @@ listPartitionedTables(const char *reltypes, const char *pattern, bool verbose)
41134113
PQExpBufferDatatitle;
41144114
PGresult*res;
41154115
printQueryOptmyopt=pset.popt;
4116-
booltranslate_columns[]= {false, false, false, false, false, false, false, false, false};
4116+
booltranslate_columns[]= {false, false, false, false, false, false, false, false, false, false};
41174117
constchar*tabletitle;
41184118
boolmixed_output= false;
41194119

@@ -4181,6 +4181,13 @@ listPartitionedTables(const char *reltypes, const char *pattern, bool verbose)
41814181

41824182
if (verbose)
41834183
{
4184+
/*
4185+
* Table access methods were introduced in v12, and can be set on
4186+
* partitioned tables since v17.
4187+
*/
4188+
appendPQExpBuffer(&buf,",\n am.amname as \"%s\"",
4189+
gettext_noop("Access method"));
4190+
41844191
if (showNested)
41854192
{
41864193
appendPQExpBuffer(&buf,
@@ -4216,6 +4223,9 @@ listPartitionedTables(const char *reltypes, const char *pattern, bool verbose)
42164223

42174224
if (verbose)
42184225
{
4226+
appendPQExpBufferStr(&buf,
4227+
"\n LEFT JOIN pg_catalog.pg_am am ON c.relam = am.oid");
4228+
42194229
if (pset.sversion<120000)
42204230
{
42214231
appendPQExpBufferStr(&buf,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp