pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12784: pg_relation_size has problems with case in index name
3+ messages / 3 participants
[nested] [flat]

* BUG #12784: pg_relation_size has problems with case in index name
@ 2015-02-18 19:27  gibheer@zero-knowledge.org
  0 siblings, 2 replies; 3+ messages in thread

From: gibheer@zero-knowledge.org @ 2015-02-18 19:27 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12784
Logged by:          Stefan Radomski
Email address:      gibheer@zero-knowledge.org
PostgreSQL version: 9.4.1
Operating system:   FreeBSD 10.1p5
Description:        

I found a problem with indexes which have an uppercase letter in the name.
You can reproduce it with the following statements:

  create table unfindable("Test" text);
  create index on unfindable("Test");
  \d unfindable
  select pg_relation_size('unfindable_Test_idx');

It does work for tables with upper case characters in the name though.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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

* Re: BUG #12784: pg_relation_size has problems with case in index name
@ 2015-02-18 19:43  David G Johnston <david.g.johnston@gmail.com>
  parent: gibheer@zero-knowledge.org
  1 sibling, 0 replies; 3+ messages in thread

From: David G Johnston @ 2015-02-18 19:43 UTC (permalink / raw)
  To: pgsql-bugs

Gibheer wrote
> The following bug has been logged on the website:
> 
> Bug reference:      12784
> Logged by:          Stefan Radomski
> Email address:      

> gibheer@

> PostgreSQL version: 9.4.1
> Operating system:   FreeBSD 10.1p5
> Description:        
> 
> I found a problem with indexes which have an uppercase letter in the name.
> You can reproduce it with the following statements:
> 
>   create table unfindable("Test" text);
>   create index on unfindable("Test");
>   \d unfindable
>   select pg_relation_size('unfindable_Test_idx');
> 
> It does work for tables with upper case characters in the name though.

To be specific: your complaint is that the system generated index name
(since you didn't provide a name of your own) does not respect the
capitalization of the table name upon which it is being created.

My guess is that the name of the table is normalized in some form in order
to make the index name less complicated - say if the table name has special
characters or embedded spaces.

Your complaint is likely better categorized as a feature request or just an
implementation detail you can live with or avoid by providing your own index
name.  I haven't dug into this at all to make a better determination.

David J.



--
View this message in context: http://postgresql.nabble.com/BUG-12784-pg-relation-size-has-problems-with-case-in-index-name-tp58384...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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

* Re: BUG #12784: pg_relation_size has problems with case in index name
@ 2015-02-18 19:43  Tom Lane <tgl@sss.pgh.pa.us>
  parent: gibheer@zero-knowledge.org
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-02-18 19:43 UTC (permalink / raw)
  To: gibheer@zero-knowledge.org; +Cc: pgsql-bugs

gibheer@zero-knowledge.org writes:
> I found a problem with indexes which have an uppercase letter in the name.
> You can reproduce it with the following statements:

>   create table unfindable("Test" text);
>   create index on unfindable("Test");
>   \d unfindable
>   select pg_relation_size('unfindable_Test_idx');

This isn't a bug.  You need to double-quote the index name, just the same
as you would do at the SQL level.

regression=# create table unfindable("Test" text);
CREATE TABLE
regression=# create index on unfindable("Test");
CREATE INDEX
regression=# \d unfindable
 Table "public.unfindable"
 Column | Type | Modifiers 
--------+------+-----------
 Test   | text | 
Indexes:
    "unfindable_Test_idx" btree ("Test")

regression=# select pg_relation_size('unfindable_Test_idx');
ERROR:  relation "unfindable_test_idx" does not exist
LINE 1: select pg_relation_size('unfindable_Test_idx');
                                ^
regression=# select pg_relation_size('"unfindable_Test_idx"');
 pg_relation_size 
------------------
             8192
(1 row)


			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



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


end of thread, other threads:[~2015-02-18 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 19:27 BUG #12784: pg_relation_size has problems with case in index name gibheer@zero-knowledge.org
2015-02-18 19:43 ` David G Johnston <david.g.johnston@gmail.com>
2015-02-18 19:43 ` Tom Lane <tgl@sss.pgh.pa.us>

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