Re: Show method of index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Khee Chin <kheechin(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, Ricardo Bessa <ricardobessa(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Show method of index
Date: 2009-05-11 23:20:12
Message-ID: 2450.1242084012@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Khee Chin escribi:
>> Updated with an additional line in the comments for get_indexdef
>>
>> * if colno == -999, we only want the name of the variables that
>> make up the index

> I don't think this hack is going to fly.

Yeah ... if it were local in describe.c that would be one thing, but
putting such a kluge in a public function API is pretty icky.

I think the proposed patch is doing pretty much the wrong thing anyhow.
As I understood it, the request was *not* to add a column to \di (which
would likely make it too wide to be readable, and would look rather
silly in a mixed-indexes-and-tables listing too). The idea was to add
a column to \d for an index, ie given something like

CREATE INDEX fooi ON foo (f1, (f2+f3))

then "\d fooi" would give

Index "public.fooi"
Column | Type | Definition
-----------------+---------+------------
f1 | integer | f1
pg_expression_2 | integer | (f2+f3)

which you could do straight off with the existing behavior of
pg_get_indexdef().

BTW, if we're going to have a different columnset for \d on indexes,
it seems like it would be a good idea to include the opclass name too,
at least in \d+.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-05-11 23:24:17 Re: Show method of index
Previous Message Josh Berkus 2009-05-11 22:17:56 Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5