FAQ
Hi Gophers,

I have a problem with the postgres pq driver(github.com/lib/pq). If i have
a date filed and it is blank, i get when scanning:

Scan error on column index 1: unsupported driver -> Scan pair: <nil> ->
*time.Time

g := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)

err = rows.Scan( &g)


What do i need to do?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Piers at Mar 6, 2015 at 7:55 pm
    Looks like pq has a type for this which works like sql.NullString[0] etc:

       http://godoc.org/github.com/lib/pq#NullTime


    [0] http://godoc.org/database/sql#NullString


    On Friday, 6 March 2015 15:17:48 UTC, will wrote:

    Hi Gophers,

    I have a problem with the postgres pq driver(github.com/lib/pq). If i
    have a date filed and it is blank, i get when scanning:

    Scan error on column index 1: unsupported driver -> Scan pair: <nil> ->
    *time.Time

    g := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)

    err = rows.Scan( &g)


    What do i need to do?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 6, '15 at 3:17p
activeMar 6, '15 at 7:55p
posts2
users2
websitegolang.org

2 users in discussion

Will: 1 post Piers: 1 post

People

Translate

site design / logo © 2022 Grokbase