void
void

Reputation: 31

pq: invalid input syntax for integer: "$1"

After I was trying to INSERT into a postgresql database simple statement from Go app this error was occurred. I've already made type assertions for int(value), but without luck.

Upvotes: 1

Views: 2452

Answers (1)

void
void

Reputation: 31

I have resolved this problem by removing single quotes from my INSERT statement.

insert into kids (age,user_id) values ($1,$2);

instead of

insert into kids (age,user_id) values ('$1','$2');

Upvotes: 2

Related Questions