title: PostgreSQL Error with Doobie: PSQLException: The column index is out of range: 3, number of columns: 2
body: <p>I am practicing with Scala, Doobie and PostgreSQL. The database is within a Docker container. I am able to post and update jobs but unable to GET all posts. I keep getting the below error.</p>
  <p>I have researched other similar questions but my differs as I am just trying to GET all from the database so I don't understand this column issue.</p>
  <p>I am starting to think I need a circe encoder to read the Json out of the database??? The circe decoder below throws at error on leftMap and on show</p>
  <pre><code>implicit val get: Get[JobPostDetails] =
   Get[Json].temap(_.as[JobPostDetails].leftMap(_.show))
  </code></pre>
  <pre><code>case class JobPost(id: String, details: JobPostDetails)
  
  case class JobPostDetails(title: String, description: String, salary: Double, employmentType: String, employer: String)
  
  </code></pre>
  <pre><code>  def createTable: doobie.Update0 = {
      sql&quot;&quot;&quot;
           |CREATE TABLE IF NOT EXISTS jobs (
           |  id TEXT PRIMARY KEY,
           |  details JSON NOT NULL
           |)
         &quot;&quot;&quot;.stripMargin
        .update
    }
  </code></pre>
  <pre><code>  def getAll: doobie.Query0[JobPost] = {
      sql&quot;&quot;&quot;
           |SELECT id, details FROM jobs
         &quot;&quot;&quot;.stripMargin
        .query[JobPost]
    }
  
  </code></pre>
  <pre><code>  def getPosts: IO[List[JobPost]] = {
      JobQueries.getAll.to[List].transact(xa)
    }
  </code></pre>
  <pre><code>09:01:50.452 [ioapp-compute-7] ERROR org.http4s.server.service-errors - Error servicing request: GET /api/v1/posts from 0:0:0:0:0:0:0:1
  org.postgresql.util.PSQLException: The column index is out of range: 3, number of columns: 2.
          at org.postgresql.jdbc.PgResultSet.checkColumnIndex(PgResultSet.java:2760) ~[postgresql-42.2.12.jar:42.2.12]
          at org.postgresql.jdbc.PgResultSet.checkResultSet(PgResultSet.java:2780) ~[postgresql-42.2.12.jar:42.2.12]
  
  </code></pre>