Re: regclass error reports improperly downcased

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <jnasby(at)enova(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Michael Elterman <melterman(at)enova(dot)com>
Subject: Re: regclass error reports improperly downcased
Date: 2013-11-08 20:21:29
Message-ID: 24972.1383942089@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim Nasby <jnasby(at)enova(dot)com> writes:
> Ahh, duh. Hrm... I ran across this because someone here got confused by this:

> SELECT pg_total_relation_size( schema_name || '.' || relname ) FROM pg_stat_all_tables
> ERROR: relation "moo" does not exist

Personally I'd do that like

select pg_total_relation_size(oid) from pg_class where ...

and avoid fooling with regclass conversion at all.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2013-11-08 20:33:24 Re: Gin page deletion bug
Previous Message Karl O. Pinc 2013-11-08 20:18:44 Re: backup.sgml-cmd-v003.patch