The query params inside a FromSelect are numbered independently from the whole query, so:
psql.Update(`mytable`).
Set("name", "newname").
FromSelect(psql.Select("column").From("anothertable").Where(sq.Eq{"column": 3})).
Where(sq.Eq{"name": "oldname"})
Args will be ["newname", "oldname", 3], but query string will be:
update mytable set name = $1
select column from anothertable where column = $1
where name = $2
Correct should be:
update mytable set name = $1
select column from anothertable where column = $3
where name = $2
FromSelect should change the placeholder count to start from where the parent Update ends
The query params inside a FromSelect are numbered independently from the whole query, so:
Args will be ["newname", "oldname", 3], but query string will be:
Correct should be:
FromSelect should change the placeholder count to start from where the parent Update ends