Re: regclass error reports improperly downcased

From: Jim Nasby <jnasby(at)enova(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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-11 18:39:12
Message-ID: 52812450.4070307@enova.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/8/13 2:21 PM, Tom Lane wrote:
> 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.

Yeah, that's what I did in this case. I'm just trying to make it more obvious to users that make this mistake.

Is anyone opposed to some kind of hint?
--
Jim Nasby, Lead Data Architect (512) 569-9461

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-11 18:57:06 Re: better atomics - spinlock fallback?
Previous Message Jeffrey Walton 2013-11-11 18:17:12 Re: Clang 3.3 Analyzer Results