News for hackers. Stuff that matters.
Re:MongoDB queries don’t always return all matching documents by chx on Tuesday June 07, 2016 @10:25PM (#11859580)
This will be highly subjective but you need to get over the "postgresql has the longest feature list so why don't you use it". The last startup I have been involved with tried to use PostgreSQL and needed to move to MySQL (yeah, well) because commercial support was both more expensive and less useful than what we were able to get for MySQL. Perhaps today it's different.

While I no longer use PostgreSQL much, every time I need to touch it seems rather developer unfriendly, just last month I found MySQL, heck even SQLite supports triggers with code inlined into the trigger body but PostgreSQL mandates writing a separate function for the trigger. And, of course, it needs to be in plpgsql because reasons. The most trivial "let's calculate another column" becomes a complicated nightmare.

So then if you don't want to use PostgreSQL what then? The answer now is MySQL, again, because 5.7 has JSON.

And mind you, I have grown to dislike MongoDB slowly over the years as new types of queries have appeared and it's a complete mess by now. There was an excellent article on this posted on Linkedin of all places this March https://www.linkedin.com/pulse/mongodb-frankenstein-monster-...

It's really interesting how MySQL is the most usable and most supported database by now...

Re:MongoDB queries don’t always return all matching documents by brandur on Tuesday June 07, 2016 @10:52PM (#11859662)
> This will be highly subjective but you need to get over the "postgresql has the longest feature list so why don't you use it".

I think if you re-read it, you might see that at no point did the post that you're replying to imply that Postgres was preferred because it had a longer list of features. They're speaking entirely about the strong guarantees that an ACID system gets you.

Document stores are only mentioned because this is one of the (incorrectly) perceived advantages that Mongo has over Postgres and other databases.

Re:MongoDB queries don’t always return all matching documents by jeffdavis on Tuesday June 07, 2016 @10:52PM (#11859664)
"just last month I found MySQL, heck even SQLite supports triggers with code inlined into the trigger body but PostgreSQL mandates writing a separate function for the trigger"

The right response, as a postgres developer, is to agree that you describe a useful feature, and perhaps implement it to help other users.

But my advice to you is to be willing to put up with some short-term annoyances. Sometimes the best choices are a little annoying, and if you refuse to consider them, it will cost you (or your employer) much more later.

Re:MongoDB queries don’t always return all matching documents by chx on Wednesday June 08, 2016 @05:48AM (#11861105)
It is listed on the TODO https://wiki.postgresql.org/wiki/Todo page, apparently since 2012. I haven't coded in C since 1998, I do not think you want me to touch the PostgreSQL code base.
Re:MongoDB queries don’t always return all matching documents by pritambaral on Wednesday June 08, 2016 @09:04AM (#11861960)
> just last month I found MySQL, heck even SQLite supports triggers with code inlined into the trigger body but PostgreSQL mandates writing a separate function for the trigger

I found something similar (and in the last month too) – insofar as we're talking missing popular features – but with MySQL's and Postgres's positions reversed.

`ALTER TABLE ... ADD CONSTRAINT CHECK ...` runs on MySQL without an issue, and so does any INSERT or UPDATE violating that CHECK constraint. A bug was filed in 2004.

Re:MongoDB queries don’t always return all matching documents by chucky_z on Wednesday June 08, 2016 @01:05AM (#11860147)
My response to the comment for triggers and PGSQL would be: Postgres tries its best to stop you shooting yourself in the foot.

Similar to the top comment, all the real problems I've ever encountered with postgres (heck, all major RDBMS's for that matter) come from certain areas, mainly triggers.