git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eeb01e3)
Remove unnecessary "DISTINCT" in psql's queries for \dAc and \dAf.
Mon, 3 Aug 2020 18:02:35 +0000 (14:02 -0400)
Mon, 3 Aug 2020 18:02:35 +0000 (14:02 -0400)
A moment's examination of these queries is sufficient to see that
they do not produce duplicate rows, unless perhaps there's
catalog corruption. Using DISTINCT anyway is inefficient and
confusing; moreover it sets a poor example for anyone who
refers to psql -E output to see how to query the catalogs.


diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 57266f4fc3515397b5c6f83a2d762cf4962520ff..d81f1575bf4c7741a1eb50f3dfd8cf547aed00f6 100644 (file)
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -6071,7 +6071,7 @@ listOperatorClasses(const char *access_method_pattern,
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
- "SELECT DISTINCT"
+ "SELECT\n"
" am.amname AS \"%s\",\n"
" pg_catalog.format_type(c.opcintype, NULL) AS \"%s\",\n"
" CASE\n"
@@ -6166,7 +6166,7 @@ listOperatorFamilies(const char *access_method_pattern,
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
- "SELECT DISTINCT"
+ "SELECT\n"
" am.amname AS \"%s\",\n"
" CASE\n"
" WHEN pg_catalog.pg_opfamily_is_visible(f.oid)\n"
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /