Show schema size with \dn+

Started by Anders Steinleinabout 16 years ago5 messages
#1Anders Steinlein
anders@steinlein.no

Is there any interest in expanding \dn+ to show schema size, similar
to table sizes using \dt+ in 8.4? We use separate schemas for each
user, so this would allow us to quickly look up the sizes of each
user's data.

I have little experience with C and none with the PostgreSQL code base
-- where should I look to have a go at this?

-- a.

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Anders Steinlein (#1)
Re: Show schema size with \dn+

Le mercredi 28 octobre 2009 à 15:11:31, Anders Steinlein a écrit :

Is there any interest in expanding \dn+ to show schema size, similar
to table sizes using \dt+ in 8.4? We use separate schemas for each
user, so this would allow us to quickly look up the sizes of each
user's data.

I have little experience with C and none with the PostgreSQL code base
-- where should I look to have a go at this?

I would say source file src/bin/psql/describe.c, function listSchemas.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Anders Steinlein (#1)
Re: Show schema size with \dn+

On Wed, 2009-10-28 at 15:11 +0100, Anders Steinlein wrote:

Is there any interest in expanding \dn+ to show schema size, similar
to table sizes using \dt+ in 8.4? We use separate schemas for each
user, so this would allow us to quickly look up the sizes of each
user's data.

A schema doesn't really have a size, because a schema is not a storage
subdivision.

#4Marcelo Costa
marcelojscosta@gmail.com
In reply to: Peter Eisentraut (#3)
Re: Show schema size with \dn+

On Thu, Oct 29, 2009 at 11:19 AM, Peter Eisentraut <peter_e@gmx.net> wrote:

On Wed, 2009-10-28 at 15:11 +0100, Anders Steinlein wrote:

Is there any interest in expanding \dn+ to show schema size, similar
to table sizes using \dt+ in 8.4? We use separate schemas for each
user, so this would allow us to quickly look up the sizes of each
user's data.

A schema doesn't really have a size, because a schema is not a storage
subdivision.

Are you sure ?

I believe that we can pass more information structuralized facilitating the
life of admins as we

This item of TODO can be constructed with these easinesses[1]http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php

- Make psql's \d commands more consistent in its handling of schemas

[1]: http://archives.postgresql.org/pgsql-hackers/2004-11/msg00014.php

--
Marcelo Costa
www.marcelocosta.net
-------------------------------------------------
“You can't always get what want”,

Doctor House in apology to Mike Jagger

#5Stephen Frost
sfrost@snowman.net
In reply to: Peter Eisentraut (#3)
Re: Show schema size with \dn+

* Peter Eisentraut (peter_e@gmx.net) wrote:

On Wed, 2009-10-28 at 15:11 +0100, Anders Steinlein wrote:

Is there any interest in expanding \dn+ to show schema size, similar
to table sizes using \dt+ in 8.4? We use separate schemas for each
user, so this would allow us to quickly look up the sizes of each
user's data.

A schema doesn't really have a size, because a schema is not a storage
subdivision.

Erm, it's a namespace inside of which objects exist. Sure, the
individual tables might be on different tablespaces, but the schema's
size is a direct aggregation of the objects which it contains.

The argument that it doesn't have a size is a bit like arguing that 'du'
should report the directory's size rather than the combined size of
everything in it.

I look forward to someone adding this, it'd be nice to have.

Thanks,

Stephen