以character varying 和 character varying[]為列J:
character varying:表示可變長(zhǎng)字符串
character varying[]: 表示可變長(zhǎng)字符串?dāng)?shù)組
在插入數(shù)據(jù)時(shí)抵恋,character varying[2] 需要插入
insertDynStmt = `insert into "test"("test") values($1)`
_, e = db.Exec(insertDynStmt, "{1,2}") //正確
_, e = db.Exec(insertDynStmt, "123") //報(bào)錯(cuò)EXTRA *pq.Error=pq: 有缺陷的數(shù)組常量:"123"