Skip to content

Commit 69c1698

Browse files
committed
psql: Don't try to print a partition constraint we didn't fetch.
If \d rather than \d+ is used, then verbose is false and we don't ask the server for the partition constraint; so we shouldn't print it in that case either. Maksim Milyutin, per a report from Jesper Pedersen. Reviewed by Jesper Pedersen and Amit Langote. Discussion: http://postgr.es/m/2af5fc4d-7bcc-daa8-4fe6-86274bea363c@redhat.com
1 parent e55d964 commit 69c1698

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/bin/psql/describe.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,13 +1985,16 @@ describeOneTableDetails(const char *schemaname,
19851985
partdef);
19861986
printTableAddFooter(&cont, tmpbuf.data);
19871987

1988-
/* If there isn't any constraint, show that explicitly */
1989-
if (partconstraintdef == NULL || partconstraintdef[0] == '\0')
1990-
printfPQExpBuffer(&tmpbuf, _("No partition constraint"));
1991-
else
1992-
printfPQExpBuffer(&tmpbuf, _("Partition constraint: %s"),
1993-
partconstraintdef);
1994-
printTableAddFooter(&cont, tmpbuf.data);
1988+
if (verbose)
1989+
{
1990+
/* If there isn't any constraint, show that explicitly */
1991+
if (partconstraintdef == NULL || partconstraintdef[0] == '\0')
1992+
printfPQExpBuffer(&tmpbuf, _("No partition constraint"));
1993+
else
1994+
printfPQExpBuffer(&tmpbuf, _("Partition constraint: %s"),
1995+
partconstraintdef);
1996+
printTableAddFooter(&cont, tmpbuf.data);
1997+
}
19951998

19961999
PQclear(result);
19972000
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy