pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6413: pg_relation_size wont work on table with upper case chars
4+ messages / 4 participants
[nested] [flat]

* BUG #6413: pg_relation_size wont work on table with upper case chars
@ 2012-01-28 16:16  james@stev.org
  0 siblings, 2 replies; 4+ messages in thread

From: james@stev.org @ 2012-01-28 16:16 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      6413
Logged by:          James Stevenson
Email address:      james@stev.org
PostgreSQL version: 8.4.9
Operating system:   Linux - Debian Squeeze
Description:        


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.





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6413: pg_relation_size wont work on table with upper case chars
@ 2012-01-28 19:28  Euler Taveira de Oliveira <euler@timbira.com>
  parent: james@stev.org
  1 sibling, 0 replies; 4+ messages in thread

From: Euler Taveira de Oliveira @ 2012-01-28 19:28 UTC (permalink / raw)
  To: james@stev.org; +Cc: pgsql-bugs

On 28-01-2012 13:16, james@stev.org wrote:
> pg_relation_size('Attempts')
> and
> pg_relation_size('attempts')
> 
pg_relation_size('"Attempts"')


-- 
   Euler Taveira de Oliveira - Timbira       http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6413: pg_relation_size wont work on table with upper case chars
@ 2012-01-28 19:33  Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  parent: james@stev.org
  1 sibling, 1 reply; 4+ messages in thread

From: Heikki Linnakangas @ 2012-01-28 19:33 UTC (permalink / raw)
  To: james@stev.org; +Cc: 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #6413: pg_relation_size wont work on table with upper case chars
@ 2012-01-28 20:30  James Stevenson <james.stevenson@stev.org>
  parent: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  0 siblings, 0 replies; 4+ messages in thread

From: James Stevenson @ 2012-01-28 20:30 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>; +Cc: pgsql-bugs

That seems to work.

thanks

-----Original Message-----
From: Heikki Linnakangas [mailto:heikki.linnakangas@enterprisedb.com] 
Sent: 28 January 2012 19:34
To: James Stevenson
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #6413: pg_relation_size wont work on table with upper case chars

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

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4763 - Release Date: 01/24/12


^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2012-01-28 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-01-28 16:16 BUG #6413: pg_relation_size wont work on table with upper case chars james@stev.org
2012-01-28 19:28 ` Euler Taveira de Oliveira <euler@timbira.com>
2012-01-28 19:33 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
2012-01-28 20:30   ` James Stevenson <james.stevenson@stev.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox