zeroc8 | 4 May 2012 13:11

Re: Postgres/pq prepare stmt question

Sorry, disregard question please.

Postgres wants $1 instead of ?


Am Freitag, 4. Mai 2012 13:05:58 UTC+2 schrieb zeroc8:

Hi, I'm trying to access Postgres using the pq driver.

Can anyone tell me why this Prepare call fails?

 stmt, err := tx.Prepare("insert into test(test) values(?)")
if err != nil {
    fmt.Println("Cannot prepare statement:",err)
    os.Exit(1)
}

==>> Cannot prepare statement: pq: S:"ERROR" L:"907" P:"32" M:"syntax error at or near \")\"" R:"base_yyerror" C:"42601" F:"scan.l"


Gmane