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