Re: Index expressions: how to recreate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index expressions: how to recreate
Date: 2003-07-01 15:00:56
Message-ID: 3186.1057071656@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-hackers

Andreas Pflug <pgadmin(at)pse-consulting(dot)de> writes:
> I noticed the new expression functionality of indices and while
> implementing them in pgadmin3 was wonderingnow to extract the definition
> from the catalog.

The best way is to use pg_get_indexdef(indexOID), same as pg_dump and
psql do.

> CREATE INDEX foo ON bar (numcol, length(txtcol), intcol2,
> length(txtcol2))

> indkey will contain 1 0 4

Actually it should be read as 1 0 4 0. The output converter for
int2vector suppresses trailing zeroes, for largely-historical reasons.

regards, tom lane

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Adam H. Pendleton 2003-07-01 16:16:15 Edit Data dialog
Previous Message Jean-Michel POURE 2003-07-01 14:23:56 GTK2 poEdit version for Arabic and Persian

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-07-01 15:13:45 Re: vacuum bug
Previous Message Tom Lane 2003-07-01 13:53:30 Re: PlPython