Re: BUG #6413: pg_relation_size wont work on table with upper case chars - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #6413: pg_relation_size wont work on table with upper case chars
Date
Msg-id 4F244DA3.30602@enterprisedb.com
Whole thread Raw
In response to BUG #6413: pg_relation_size wont work on table with upper case chars  (james@stev.org)
Responses Re: BUG #6413: pg_relation_size wont work on table with upper case chars
List pgsql-bugs
On 28.01.2012 18:16, james@stev.org wrote:
> I suspect pg_relation_size has a tolower in it to a table name called
> Attempts will not work with pg_relation_size
>
> Both
>
> pg_relation_size('Attempts')
> and
> pg_relation_size('attempts')
>
> fails with no such table.
>
> After table rename from Attempts to attempts it will work.

Try double-quoting the table name, within the single-quotes:
pg_relation_size('"Attempts"').

This is explained in the context of nextval() function at:

http://www.postgresql.org/docs/9.1/static/functions-sequence.html

Looks like the manual page on pg_relation_size(), or "Object Identifier
Types" where the regclass datatype is otherwise explained, don't mention
anything about the double-quoting. Patches to improve that are welcome..

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #6413: pg_relation_size wont work on table with upper case chars
Next
From: Michael Brauwerman
Date:
Subject: Re: BUG #6200: standby bad memory allocations on SELECT