Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Remove unnecessary "DISTINCT" in psql's queries for \dAc and \dAf.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Aug 2020 18:02:35 +0000 (14:02 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
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.

src/bin/psql/describe.c

index 25d5b06de253c043147d1661e8457e5fdf6976e1..cc11150f237f0c0e70f328e3bb8a4ccd4c6091f3 100644 (file)
@@ -6065,7 +6065,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"
@@ -6160,7 +6160,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"