News for hackers. Stuff that matters.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by michaelt on Tuesday July 10, 2018 @05:29PM (#17502355)
Bind variables are the ? in "SELECT fname, lname, pcode FROM cust WHERE id = ?" and they're a better choice than concatenating the ID you want into the SQL string because (a) it prevents SQL injection and (b) it lets the query optimiser cache plans.

We have plenty of complicated queries - when we've got complex SQL queries, we find it valuable to have pure SQL as you can paste it into a tool that lets you execute it on the database and view the results, the explain plans, and suchlike.

Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by ntqz on Friday July 13, 2018 @01:37PM (#17524968)
Another bonus - depending on your DB/driver, it may set this up as a prepared statement, so executions after the first one happen much quicker.