From: Tom Lane <tgl@sss.pgh.pa.us>
To: gibheer@zero-knowledge.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12784: pg_relation_size has problems with case in index name
Date: Wed, 18 Feb 2015 14:43:32 -0500
Message-ID: <30858.1424288612@sss.pgh.pa.us> (raw)
In-Reply-To: <20150218192712.8729.67799@wrigleys.postgresql.org>
References: <20150218192712.8729.67799@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, gibheer@zero-knowledge.org
Subject: Re: BUG #12784: pg_relation_size has problems with case in index name
In-Reply-To: <30858.1424288612@sss.pgh.pa.us>
References: <20150218192712.8729.67799@wrigleys.postgresql.org> <30858.1424288612@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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