code: func PgRewriteByOid(db XODB, oid pgtypes.Oid) (*PgRewrite, error) {
  	var err error
  
  	// sql query
  	const sqlstr = `SELECT ` +
  		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, rulename, ev_class, ev_type, ev_enabled, is_instead, ev_qual, ev_action ` +
  		`FROM pg_catalog.pg_rewrite ` +
  		`WHERE oid = $1`
  
  	// run query
  	XOLog(sqlstr, oid)
  	pr := PgRewrite{}
  
  	err = db.QueryRow(sqlstr, oid).Scan(&pr.Tableoid, &pr.Cmax, &pr.Xmax, &pr.Cmin, &pr.Xmin, &pr.Oid, &pr.Ctid, &pr.Rulename, &pr.EvClass, &pr.EvType, &pr.EvEnabled, &pr.IsInstead, &pr.EvQual, &pr.EvAction)
  	if err != nil {
  		return nil, err
  	}
  
  	return &pr, nil
  }
docs: // PgRewriteByOid retrieves a row from 'pg_catalog.pg_rewrite' as a PgRewrite.
  //
  // Generated from index 'pg_rewrite_oid_index'.