title: Inserting an array into a Postgresql database
body: <p>I want to be able to write an array of bigints into a table that I am using for history in Go. Unfortunately, I can't and when I do the error <code>sql: converting Exec argument #1's type: unsupported type []int64, a slice</code> is thrown. Here's what I'm doing, edited for brevity:</p>
  
  <pre><code>type Card struct {
      cid int64
  }
  
  type Transaction struct {
          tid, cardid int64
          productids []int64
          salepoint int
          cardkey string
  }
  
  func logPurchase(card *Card, t *Transaction) {
       _, err := db.Exec("INSERT INTO history VALUES ($1, $2, $3, $4)", rand.Int63(), t.productids, card.cid, t.salepoint);
  }
  </code></pre>
  
  <p>This is the structure of the table that I wish to insert into:
  <code>tid bigint primary key, productids bigint[] not null, cardid bigint not null, salepoint int</code></p>