Show relation size in verbose (e.g. \d+) output.
authorHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 2 May 2008 10:16:16 +0000 (10:16 +0000)
committerHeikki Linnakangas <heikki@enterprisedb.com>
Fri, 2 May 2008 10:16:16 +0000 (10:16 +0000)
Dickson S. Guedes

src/bin/psql/describe.c

index 8487a2b9ae32368da12efc2210a1b6ba0e056f92..7e585805763522853d3c24ef591cfca136882c66 100644 (file)
@@ -1766,9 +1766,14 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
                                                  gettext_noop("Table"));
 
        if (verbose)
+       {
+               appendPQExpBuffer(&buf,
+                                                 ",\n  pg_catalog.pg_size_pretty(pg_catalog.pg_relation_size(c.oid)) as \"%s\"",
+                                                 gettext_noop("Size"));
                appendPQExpBuffer(&buf,
                          ",\n  pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
                                                  gettext_noop("Description"));
+       }
 
        appendPQExpBuffer(&buf,
                                          "\nFROM pg_catalog.pg_class c"