psql \db+ lack of size column

Started by Fabrízio de Royes Melloover 11 years ago3 messages
#1Fabrízio de Royes Mello
fabriziomello@gmail.com

Hi all,

Are there some reason to don't show the tablespace size in the \db+ psql
command?

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL

Show quoted text

Timbira: http://www.timbira.com.br
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello

#2Fabrízio de Royes Mello
fabriziomello@gmail.com
In reply to: Fabrízio de Royes Mello (#1)
1 attachment(s)
Re: psql \db+ lack of size column

On Fri, May 16, 2014 at 2:03 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

Hi all,

Are there some reason to don't show the tablespace size in the \db+ psql

command?

The attached patch show tablespace size in \db+ psql command.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL

Show quoted text

Timbira: http://www.timbira.com.br
Blog sobre TI: http://fabriziomello.blogspot.com
Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello

Attachments:

psql-show-tablespace-size-v1.patchtext/x-patch; charset=US-ASCII; name=psql-show-tablespace-size-v1.patchDownload
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 951b7ee..282cd43 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -176,6 +176,11 @@ describeTablespaces(const char *pattern, bool verbose)
 						  ",\n  spcoptions AS \"%s\"",
 						  gettext_noop("Options"));
 
+	if (verbose && pset.sversion >= 90200)
+		appendPQExpBuffer(&buf,
+						  ",\n  pg_catalog.pg_size_pretty(pg_catalog.pg_tablespace_size(oid)) AS \"%s\"",
+						  gettext_noop("Size"));
+
 	if (verbose && pset.sversion >= 80200)
 		appendPQExpBuffer(&buf,
 		 ",\n  pg_catalog.shobj_description(oid, 'pg_tablespace') AS \"%s\"",
#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Fabrízio de Royes Mello (#2)
Re: psql \db+ lack of size column

Fabr�zio de Royes Mello wrote:

On Fri, May 16, 2014 at 2:03 AM, Fabr�zio de Royes Mello <
fabriziomello@gmail.com> wrote:

Hi all,

Are there some reason to don't show the tablespace size in the \db+
psql command?

The attached patch show tablespace size in \db+ psql command.

Thanks, pushed.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers