Re: pg_relation_size, relation does not exist

From: Frank Heikens <frankheikens(at)mac(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Whit Armstrong <armstrong(dot)whit(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_relation_size, relation does not exist
Date: 2009-06-16 15:12:28
Message-ID: A64F3C3F-B318-48A0-ABA8-089BE41A912F@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The same problem, missing oid's, occurs with several other system
views as well. If you have to do some serious work, it's always
pg_class you need.

oid's in these views would be nice, but only if all the system views
have the oid's of the underlaying objects. In case of pg_tables you
need the oid's of the schema and the table.

http://www.postgresql.org/docs/8.3/static/views-overview.html

Regards,
Frank

Op 16 jun 2009, om 16:52 heeft Magnus Hagander het volgende geschreven:

> Actually, is there any particular reason why we can't *add* that
> column
> to the view in a future version? We certainly shouldn't go modify it,
> but adding to it should be pretty safe, no?
>
> --
> Magnus Hagander
> Self: http://www.hagander.net/
> Work: http://www.redpill-linpro.com/
>
>
> Frank Heikens wrote:
>> Agreed.
>>
>> Personally I wouldn't use pg_tables at all because of the missing
>> oid.
>> Would be nice to have in this view, but it can't be changed because
>> it's
>> a system-view. pg_class would do the job.
>>
>> Regards,
>> Frank
>>
>>
>> Op 16 jun 2009, om 16:12 heeft Tom Lane het volgende geschreven:
>>
>>> Frank Heikens <frankheikens(at)mac(dot)com> writes:
>>>> pg_size_pretty(pg_relation_size(schemaname || '.' || tablename))
>>>
>>> At some point you're going to wish you'd used quote_ident() here.
>>>
>>> regards, tom lane
>>>
>>> PS: Personally I prefer to rely on pg_relation_size(oid), but to use
>>> that you need to be looking directly at pg_class, not at pg_tables
>>> which doesn't expose the oid column :-(
>>>
>>> --
>>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-general
>>
>>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Todd Lieberman 2009-06-16 15:24:07 Re: 10 TB database
Previous Message Magnus Hagander 2009-06-16 14:52:55 Re: pg_relation_size, relation does not exist