Re: [HACKERS] Index expressions: how to recreate

2003-07-02 Thread Christopher Kings-Lynne
> Clearly understood, while pgadmin3 will always behave quite backend > specific. The code for index display broke just shortly ago, because the > column pg_index.indproc went away. There's a growing number of version > specific stuff in it, because we try to prevent the user from doing > illegal s

Re: [HACKERS] Index expressions: how to recreate

2003-07-02 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Does anyone else think it's reasonable to define a backend function >> along the lines of pg_get_indexdef(indexoid, columnnumber) that >> retrieves just the column-name-or-expression for the indicated column >> of the index? > There's

Re: [HACKERS] Index expressions: how to recreate

2003-07-02 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug <[EMAIL PROTECTED]> writes: 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 spl

Re: [HACKERS] Index expressions: how to recreate

2003-07-02 Thread Dave Page
> -Original Message- > From: Tom Lane [mailto:[EMAIL PROTECTED] > Sent: 01 July 2003 23:26 > To: Andreas Pflug > Cc: PostgreSQL Development > Subject: Re: [HACKERS] Index expressions: how to recreate > > Does anyone else think it's reasonable to define a

Re: [HACKERS] Index expressions: how to recreate

2003-07-01 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> The best way is to use pg_get_indexdef(indexOID), same as pg_dump and >> psql do. > [ doesn't want to parse the pg_get_indexdef output... ] Well, I guess if you just want one column it's kind of a pain. > pg_get_indexdef converts tha

Re: [HACKERS] Index expressions: how to recreate

2003-07-01 Thread Andreas Pflug
Tom Lane wrote: Andreas Pflug <[EMAIL PROTECTED]> 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

Re: [HACKERS] Index expressions: how to recreate

2003-07-01 Thread Tom Lane
Andreas Pflug <[EMAIL PROTECTED]> 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

[HACKERS] Index expressions: how to recreate

2003-07-01 Thread Andreas Pflug
I noticed the new expression functionality of indices and while implementing them in pgadmin3 was wonderingnow to extract the definition from the catalog. Consider an index that looks like this: CREATE INDEX foo ON bar (numcol, length(txtcol), intcol2, length(txtcol2)) Looking at pg_index: