docs: function (table, opts) {
              opts = opts || {};
              var m = this.outputIdentifierFunc;
              var im = this.inputIdentifierFunc;
              var parts = this.__schemaAndTable(table), schema = parts[0];
              table = parts[1];
              return this.serverVersion().chain(function (version) {
                  var attNums;
                  if (version >= 80100) {
                      attNums = sql.ANY("ind__indkey");
                  } else {
                      attNums = [];
                      for (var i = 0; i < 32; i++) {
                          attNums.push(new Subscript("ind__indkey", [i]));
                      }
                  }
                  var orderRange = [];
                  for (var j = 0; j < 32; j++) {
                      orderRange.push(new Subscript("ind__indkey", [j]));
                  }
                  orderRange = sql["case"](orderRange, 32, "att__attnum");
                  var ds = this.metadataDataset.from("pg_class___tab")
                      .join("pg_index___ind", [
                          [identifier("indrelid"), identifier("oid")],
                          [im(table), "relname"]
                      ])
                      .join("pg_class___indc", [
                          [identifier("oid"), identifier("indexrelid")]
                      ])
                      .join("pg_attribute___att", [
                          [identifier("attrelid"), identifier("tab__oid")],
                          [identifier("attnum"), attNums]
                      ])
                      .filter({"indc__relkind": 'i', "ind__indisprimary": false, indexprs: null, indpred: null})
                      .order("indc__relname", orderRange)
                      .select("indc__relname___name", "ind__indisunique___unique", "att__attname___column");
  
                  if (schema) {
                      ds = ds.join("pg_namespace___nsp", {oid: identifier("tab__relnamespace"), nspname: schema.toString()});
                  }
                  if (version >= 80200) {
                      ds = ds.filter({indisvalid: true});
                  }
                  if (version >= 80300) {
                      ds = ds.filter({indisready: true, indcheckxmin: false});
                  }
                  var indexes = {};
                  return ds.forEach(function (r) {
                      var ident = m(r.name), i = indexes[ident];
                      if (!i) {
                          i = indexes[ident] = {columns: [], unique: r.unique};
                      }
                      i.columns.push(r.column);
                  }).chain(function () {
                      return indexes;
                  });
              });
          }