title: How to assign pgtype.UUIDArray to []uuid.UUID?
body: <p>I use Go + Postgres. To work with Postgres I use <a href="https://github.com/JackC/pgx" rel="nofollow noreferrer">pgx</a>.
  I have an array of UUID in my Postgres table and a Struct with []*uuid.UUID (from <a href="https://github.com/gofrs/uuid" rel="nofollow noreferrer">github.com/gofrs/uuid</a>) in Go (see code below).</p>
  
  <p>The problem is that I always get error when I try to use AssignTo function </p>
  
  <blockquote>
    <p>cannot: decode &amp;pgtype.UUIDArray{Elements:[]pgtype.UUID(nil),
    Dimensions:[]pgtype.ArrayDimension(nil), Status:0x2} into *[]*uuid.UUID</p>
  </blockquote>
  
  <p>(I have tried to use all combinations with pointers and it doesn't work)</p>
  
  <p>My struct (for API):</p>
  
  <pre><code>type Book struct {
      AuthorIds []*uuid.UUID `json:"author_ids"`
  }
  </code></pre>
  
  <p>My struct (for working with Postgres):</p>
  
  <pre><code>type PgBook struct {
      AuthorIds pgtype.UUIDArray `db:"author_ids"`
  }
  </code></pre>
  
  <p>And I use <code>AssignTo</code> function from <code>pgx</code></p>
  
  <pre><code>err := pgBook.AuthorIds.AssignTo(&amp;book.AuthorIds)
  </code></pre>
  
  <p>How to solve this problem?</p>