title: How do I solve «panic: sql: unknown driver "postgres" (forgotten import?)»?
body: <p>I'm trying to INSERT data into POSTGRES from a .csv (pre-fixed width / tabular ) with GO.</p>
  
  <p>What I've done:</p>
  
  <pre><code>package main
  
  import (
      "bufio"
      "database/sql"
      "encoding/csv"
      "encoding/json"
      "fmt"
      "io"
      "log"
      "os"
  )
  
  type Consumidor struct {
      CPF string   `json:"CPF"`
      Private  string   `json:"Private"`
      Incompleto  string   `json:"Incompleto"`
      Compras   *Compras `json:"Compras,omitempty"`
  }
  
  type Compras struct {
      DataUltimacompra  string `json:"DataUltimacompra"`
      TicketMedio string `json:"TicketMedio"`
      TicketUltimaCompra string `json:"TicketUltimaCompra"`
      LojaMaisFrequente string `json:"LojaMaisFrequente"`
      LojaUltimaCompra string `json:"LojaUltimaCompra"`
  }
  
  const (
      host     = "localhost"
      port     = 5432
      user     = "postgres"
      password = ""
      dbname   = "neoway"
  )
  
  func main() {
      csvFile, _ := os.Open("data.csv")
      reader := csv.NewReader(bufio.NewReader(csvFile))
      var dadosinsert []Consumidor
      for {
          line, error := reader.Read()
          if error == io.EOF {
              break
          } else if error != nil {
              log.Fatal(error)
          }
          dadosinsert = append(dadosinsert, Consumidor{
              CPF: line[0],
              Private:  line[1],
              Incompleto: line[2],
              Compras: &amp;Compras{
                  DataUltimacompra:  line[3],
                  TicketMedio:  line[4],
                  TicketUltimaCompra: line[5],
                  LojaMaisFrequente:  line[6],
                  LojaUltimaCompra: line[7],
  
              },
          })
      }
      peopleJson, _ := json.Marshal(dadosinsert)
      fmt.Println(string(peopleJson))
  
      psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+
          "password=%s dbname=%s sslmode=disable",
          host, port, user, password, dbname)
      db, err := sql.Open("postgres", psqlInfo)
      if err != nil {
          panic(err)
      }
      defer db.Close()
  
      sqlStatement := `
  INSERT INTO base_teste (CPF,"PRIVATE","INCOMPLETO","DATA DA ÚLTIMA COMPRA","TICKET MÉDIO","TICKET DA ÚLTIMA COMPRA","LOJA MAIS FREQUÊNTE","LOJA DA ÚLTIMA COMPRA")
  )
  VALUES ($1, $2, $3, $4, $5, $6, 7$, 8$)
  RETURNING id`
      id := 0
      err = db.QueryRow(sqlStatement, 30, "a", "b", "c").Scan(&amp;id)
      if err != nil {
          panic(err)
      }
      fmt.Println("New record ID is:", id)
  }
  </code></pre>
  
  <p>when I run, I get this error</p>
  
  <blockquote>
    <p>[{"CPF":"xxxxx","Private":"TRUE","Incompleto":"FALSE","Compras":{"DataUltimacompra":"12/10/2018","TicketMedio":"200","TicketUltimaCompra":"250","LojaMaisFrequente":"111.111.111-99","LojaUltimaCompra":"111.111.111-88"}}]
    panic: sql: unknown driver "postgres" (forgotten import?)</p>
    
    <p>goroutine 1 [running]: main.main()    C:/Users/Willian/Desktop/NEOWAY
    PROJECT/neoway csv prefixed width importer/main.go:70 +0xbed</p>
    
    <p>Process finished with exit code 2</p>
  </blockquote>