Dave Page wrote:


You have pg_database_size(oid) and database_size(name). Afaict, the
latter is equivalent to:

SELECT pg_database_size((SELECT oid FROM pg_database WHERE datname =
'foo'))

The typing is even more e.g. for tables or indexes, though. Of course you can use the raw form, but why do we have pg_tables if there is pg_class anyway.

My main concern is that the names are inconsistent for no obvious
reason.

That could be fixed by having:
pg_database_size(name)
pg_database_size(oid)

The original idea was probably to name "internal" functions with pg_ and more user friendly ones without pg_. That does not mean it's a good idea.

I also questioned whether or not the bloat of an additional
function is worthwhile for what is probably a very small number of psql
users that might use it (probably quite rarely), however if people say
they would use it and that it's wothwhile, I wouldn't argue with it's
inclusion.

Well, I don't feel this is really bloat. I have been using them since the creation of the contrib module and have found them quite useful.

Best Regards,
Michael Paesold

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to