Re: Query to generate CREATE INDEX statement from

From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Query to generate CREATE INDEX statement from
Date: 2011-03-24 00:16:09
Message-ID: AANLkTi=-KCaMCNuR+cCdbGtfApxkumJ_gf-FS7AxN2Li@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/3/24 Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>:
> I'm building some partitioning support functions. I'm working on writing one
> called clone_indexes_to_partition right now. The idea is to take all the
> indexes applied to the parent and create a matching index on the child. Is
> there existing code that generates a CREATE INDEX statement given
> an indexrelid?

Yes it is :
http://www.postgresql.org/docs/9.0/static/functions-info.html
pg_get_indexdef(index_oid) get CREATE INDEX command for index

> Andrew

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-03-24 00:21:07 Re: Query to generate CREATE INDEX statement from
Previous Message Jaime Casanova 2011-03-24 00:11:36 Re: missing history for pg_exec_query_string()