Re: Show method of index

From: David Fetter <david(at)fetter(dot)org>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Ricardo Bessa <ricardobessa(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Show method of index
Date: 2009-05-09 18:02:25
Message-ID: 20090509180225.GV18067@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 08, 2009 at 04:43:44PM -0400, Alvaro Herrera wrote:
> Ricardo Bessa escribió:
> > Hi,
> >
> > I think that can be useful the command \di on psql show the method of
> > index (hash, btree, ...) like:
> >
> > test=# \di
> > List of relations
> > Schema | Name | Type | Owner | Table | Method
> > --------+---------------+-------+------------+--------+--------
> > public | test_id_idx | index | postgresql | table1 | btree
> > public | test_name_idx | index | postgresql | table1 | hash
> > (2 rows)
>
> Well, you can see that with \d on the table, but IMHO this should be
> present on \di too, so +1.
>
> One gripe I had with \d and indexes the other day is that it sucks
> on functional indexes -- it just says "pg_expression_1".

So after a little wrong-tree-up-barking, I grepped the source tree for
pg_expression, and it turns out that the fault lies not in psql, but
in src/backend/catalog/index.c's ConstructTupleDescriptor, which
automatically names the with this, um, somewhat uninformative name. I
see this comment just above the offending code:

/*
* Make the attribute's name "pg_expresssion_nnn" (maybe
* think of
* something better later)
*/

Any ideas for a better naming convention?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-05-09 19:02:00 Re: Show method of index
Previous Message abdelhak benmohamed 2009-05-09 17:54:07 postgres and postmaster