Open psankar opened 6 years ago
I compressed the SELECT query to a single line (instead of the newlines) and that seem to solve the issue.
db.QueryRow(
"SELECT ifsc, ba.name, branch, address, city, district, state FROM branches, banks ba WHERE ba.id = bank_id AND ifsc = $1",
x.IFSC).Scan(&t.IFSC, &t.BankName, &t.Branch,
&t.Address, &t.City, &t.District, &t.State)
I have the following postgresql query which works fine in psql but fails in the pq driver.
The corresponding golang code is:
the error message is:
pq: syntax error at or near "branches"
Instead of the $1, I have tried hard-coding the actual IFSC code too (copy pasting the same query from the psql cli) and still I get the same error.
Is it a bug or am I doing something wrong ?