Re: Index expressions: how to recreate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index expressions: how to recreate
Дата
Msg-id 3186.1057071656@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Index expressions: how to recreate  (Andreas Pflug <pgadmin@pse-consulting.de>)
Список pgsql-hackers
Andreas Pflug <pgadmin@pse-consulting.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: vacuum bug
Следующее
От: Jan Wieck
Дата:
Сообщение: New position and new location