I need to perform something like this:
pg.query(`insert into tbl (field1, field2) values($1, $2)`, ["a", "(select id from another_table limit 1)"])
this causes the following error
error: invalid input syntax for type uuid: "(select id from another_table limit 1)"
Rewrite the INSERT to use a SELECT:
However, a LIMIT without an ORDER BY is rather strange and can lead to unexpected results.