Re: How to retrieve functional index column names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: glogy(at)centrum(dot)cz (Jakub)
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to retrieve functional index column names
Date: 2004-01-09 05:56:23
Message-ID: 21010.1073627783@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

glogy(at)centrum(dot)cz (Jakub) writes:
> I need to retrieve the name of the function and the index column names
> of the functional index. The system information about the
> index(function and its args) is stored in the system catalog column
> pg_index.indexprs.

As of 7.4, this is a requirement badly in need of reconsideration.
What makes you think there is any function name involved? Consider
something like
create index i on t ((col + 2));

Getting the column names is still a sensible operation though. I'd
suggest looking in pg_depend to see which columns of the table the
index depends on.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Swan 2004-01-09 07:07:24 Re: psql \d option list overloaded
Previous Message Bruno Wolff III 2004-01-09 04:10:35 Re: Restrict users from describing table