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?
Andrew