code: func PgTableIndexes(db XODB, schema string, table string) ([]*Index, error) {
  	var err error
  
  	// sql query
  	const sqlstr = `SELECT ` +
  		`DISTINCT ic.relname, ` + // ::varchar AS index_name
  		`i.indisunique, ` + // ::boolean AS is_unique
  		`i.indisprimary, ` + // ::boolean AS is_primary
  		`0, ` + // ::integer AS seq_no
  		`'', ` + // ::varchar AS origin
  		`false ` + // ::boolean AS is_partial
  		`FROM pg_index i ` +
  		`JOIN ONLY pg_class c ON c.oid = i.indrelid ` +
  		`JOIN ONLY pg_namespace n ON n.oid = c.relnamespace ` +
  		`JOIN ONLY pg_class ic ON ic.oid = i.indexrelid ` +
  		`WHERE i.indkey <> '0' AND n.nspname = $1 AND c.relname = $2`
  
  	// run query
  	XOLog(sqlstr, schema, table)
  	q, err := db.Query(sqlstr, schema, table)
  	if err != nil {
  		return nil, err
  	}
  	defer q.Close()
  
  	// load results
  	res := []*Index{}
  	for q.Next() {
  		i := Index{}
  
  		// scan
  		err = q.Scan(&i.IndexName, &i.IsUnique, &i.IsPrimary, &i.SeqNo, &i.Origin, &i.IsPartial)
  		if err != nil {
  			return nil, err
  		}
  
  		res = append(res, &i)
  	}
  
  	return res, nil
  }
docs: // PgTableIndexes runs a custom query, returning results as Index.