From: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgadmin-hackers(at)postgresql(dot)org |
Subject: | Re: [HACKERS] Index expressions: how to recreate |
Date: | 2003-07-01 21:38:34 |
Message-ID: | 3F01FF5A.7060701@pse-consulting.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers pgsql-hackers |
Tom Lane wrote:
>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.
>
>
So far for the SQL window, which will show just a plain (and hopefully
nicely formatted. readable) sql query to recreate the index. Still, a
verbose display of the indexes property is not possible this way, unless
I parse the pg_get_indexdef output...
pg_get_indexdef converts that string to a list of nodes (not
surprising), while pg_get_expr whill join these list elements with an
explicit and (according to a comment, needed for partial index). Do I
need to retrieve indexprs and split it myself (counting brackets) or is
there a pg_xxx function that could help me (pg_get_element(indexprs,
0...n)) ?
>Actually it should be read as 1 0 4 0. The output converter for
>int2vector suppresses trailing zeroes, for largely-historical reasons.
>
Ok, I understand that, because indkey[n>4] will deliver 0 too, and
indnatts will show that 4 arguments are needed.
Regards,
Andreas
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Pflug | 2003-07-01 21:41:18 | Re: [pgadmin-support] copy paste ? |
Previous Message | Dave Page | 2003-07-01 21:09:40 | Re: First Debian package release |
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Pflug | 2003-07-01 21:43:45 | Re: Index expressions: how to recreate |
Previous Message | Markus Bertheau | 2003-07-01 21:37:54 | Re: make check fails: user "postgres" doesn't exist |