Skip to content

Error in WHERE Clause, sqlx w/ postgres #360

Description

@BlakeBrown

I am running a query in Golang, using the sqlx library:

rows, dbErr := db.Queryx(`
	SELECT *
	FROM table_a as a
	   INNER JOIN table_b AS b
	      ON a.b_id = b.id
	   WHERE b.id = 'b3c06feb-8bd1-42e1-b516-c1121990ff81';
	`)

The query is syntactically correct, and runs fine in Postico, terminal, etc. However when I try to run this query in Golang I get the error pq: syntax error at or near "  WHERE"

Can anyone explain this strange behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions