func NewRedshift() (*Redshift, error) {
	flag.Parse()
	source := fmt.Sprintf("host=%s port=%d dbname=%s connect_timeout=%d", *host, *port, *db, int(timeout.Seconds()))
	log.Println("Connecting to Reshift Source: ", source)
	source += fmt.Sprintf(" user=%s password=%s", *user, *pwd)
	sqldb, err := sql.Open("postgres", source)
	if err != nil {
		return nil, err
	}
	return &Redshift{sqldb, awsAccessKeyID, awsSecretAccessKey}, nil
}
NewRedshift returns a pointer to a new redshift object using configuration values set in the
flags.
package redshift
import (
	"database/sql"
	"flag"
	"fmt"
	"log"
	"sort"
	"strings"
	"time"
	"github.com/Clever/postgres-to-redshift/postgres"
	"github.com/facebookgo/errgroup"
	"github.com/segmentio/go-env"
)
type dbExecCloser interface {
	Close() error
	Exec(query string, args ...interface{}) (sql.Result, error)
}
type Redshift struct {
	dbExecCloser
	accessID  string
	secretKey string
}
var (
	awsAccessKeyID     = env.MustGet("AWS_ACCESS_KEY_ID")
	awsSecretAccessKey = env.MustGet("AWS_SECRET_ACCESS_KEY")
	host               = flag.String("redshifthost", "", "Address of the redshift host")
	port               = flag.Int("redshiftport", 0, "Address of the redshift host")
	db                 = flag.String("redshiftdatabase", "", "Redshift database to connect to")
	user               = flag.String("redshiftuser", "", "Redshift user to connect as")
	pwd                = flag.String("redshiftpassword", "", "Password for the redshift user")
	timeout            = flag.Duration("redshiftconnecttimeout", 10*time.Second,
		"Timeout while connecting to Redshift. Defaults to 10 seconds.")
)