News for hackers. Stuff that matters.
Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by sanderjd on Tuesday July 10, 2018 @03:30PM (#17501332)
What are "bind variables"?

I'm not talking about a search API, I'm talking about code units that ask myriad questions of the database in order to implement myriad business logic. If you don't have the problem of asking myriad questions of the database, fair enough, but that is a simpler database-connected-software use case than any I've come across (including the ones I thought were pretty simple). I'm very curious now what your service does :)

Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by gaius on Tuesday July 10, 2018 @06:17PM (#17502699)
What are "bind variables"?

I’m sorry, but bind variables are Database 101. I have a hard time believing your use cases are particularly “myriad” given lack of the very basics.

Re:Ask HN: Have you ever chosen Postgres over Mongo and regr... by dahauns on Wednesday July 11, 2018 @11:50AM (#17507838)
No. "bind variables" are Oracle 101. Everyone else calls them "query parameters".
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.