Live data from Hacker News

Postgres 11 – A First Look

craigkerstiens.com

121–130 of 193 posts

Re: Postgres 11 – A First Look

#121
post #87

Earlier quoted context omitted.

Postgres has much better SQL support and has features which will make you smile if you end writing complex queries for some purposes (like reporting).

Yesterday a friend developer told me he was trying to code a query on MySQL to get the latest message of every conversation stored in a table like conversation id, timestamp, user id, message. I did that years ago so I told him he'll find a lot of solutions on Stackoverflow, ugly ones with MySQL and much better ones for PostgreSQL which has a nrow() function. A MySQL DBA solved that problem in that project I worked o…

Stored procedures are plaintext code running on production servers and is, in general, never cleanly redeployed. So by default they discourage source control. This is my primary problem with them. Also that (at least MySQL) has shitty error messages when you're trying to build/debug the things.

Re: Postgres 11 – A First Look

#122
post #34

Earlier quoted context omitted.

Original author here. Yes, it's great to learn Ctrl + D. But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I still recall the first time I was in vi and I couldn't figure out how to get out of the damn thing, and don't get me started on arrow keys…

You use the word intuitive a couple of times, and suggest there's a natural way to exit interactive cli programs (and it's not ctrl-d). Yet for me, ctrl-d is my usual first way of trying to exit any shell or cli utility. Whether it's natural or not, I couldn't say. Arguably the nipple is the first and only intuitive interface, everything after that is learned. After many years on my/maria I find the backslash shortcu…

"You use the word intuitive a couple of times, and suggest there's a natural way to exit interactive cli programs (and it's not ctrl-d)."

Surely it is when you detect the angry mashing of keys?

There should really be a function for that in the standard library. Distinguishing such inputs from the actions of cats would be the difficult bit.

Re: Postgres 11 – A First Look

#123
post #87

Earlier quoted context omitted.

Yesterday a friend developer told me he was trying to code a query on MySQL to get the latest message of every conversation stored in a table like conversation id, timestamp, user id, message. I did that years ago so I told him he'll find a lot of solutions on Stackoverflow, ugly ones with MySQL and much better ones for PostgreSQL which has a nrow() function. A MySQL DBA solved that problem in that project I worked o…

I've had to debug a stored procedure, they're horrible when you have to do that. Just a big headache. I literally rewrote every single one of those procedures in the software's primary language, the code can now be easily debugged, logged, replaced and read.

I'm not a big fan of PL/SQL. Almost nobody is, so your approach is standard.

It's ok if all accesses to the database go through the primary application. Triggers and stored procedures make more sense when a database serves multiple applications possibly in multiple languages. Think of the db as the microservice in front of the data store. Simple stored procedures are no that bad.

Re: Postgres 11 – A First Look

#124

Earlier quoted context omitted.

Original author here. Yes, it's great to learn Ctrl + D. But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I still recall the first time I was in vi and I couldn't figure out how to get out of the damn thing, and don't get me started on arrow keys…

> But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I disagree with you here, Craig. In my experience I reach for Ctrl + D, Ctrl + C in quick succession to see what succeeds. I've learnt those and it works for most programs that don't trap exits (…

>why would you trap exit?

flush buffers, gracefully close sockets, print the final \LF to the stdout.

Re: Postgres 11 – A First Look

#125

Earlier quoted context omitted.

Original author here. Yes, it's great to learn Ctrl + D. But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I still recall the first time I was in vi and I couldn't figure out how to get out of the damn thing, and don't get me started on arrow keys…

> But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I disagree with you here, Craig. In my experience I reach for Ctrl + D, Ctrl + C in quick succession to see what succeeds. I've learnt those and it works for most programs that don't trap exits (…

> I like that and I'd prefer to have one way of exiting programs that works on all programs on the system than learn what's any programs preferred command.

I bet you love Vim ;-P

Re: Postgres 11 – A First Look

#126
post #34

Earlier quoted context omitted.

Original author here. Yes, it's great to learn Ctrl + D. But losing out on beginners that aren't familiar in favor of things that are naturally intuitive is a great way to make those who are new to programming and especially databases feel like they're dumb or not capable of it. I still recall the first time I was in vi and I couldn't figure out how to get out of the damn thing, and don't get me started on arrow keys…

You use the word intuitive a couple of times, and suggest there's a natural way to exit interactive cli programs (and it's not ctrl-d). Yet for me, ctrl-d is my usual first way of trying to exit any shell or cli utility. Whether it's natural or not, I couldn't say. Arguably the nipple is the first and only intuitive interface, everything after that is learned. After many years on my/maria I find the backslash shortcu…

And yet CTRL+D does not take you out from an Erlang console...

Re: Postgres 11 – A First Look

#127
post #12
post #10

Earlier quoted context omitted.

Yet, principle of least surprise. What is more surprising, Ctrl+D working or quit/exit not working? Maybe I am an outlier but I would try exit/quit/bye first.

Anyone using psql should be familiar with bash. Anyone using bash should be familiar with readline. Anyone familiar with readline should instantly recognize psql as being a readline input. It seems like a reasonable set of conclusions to draw, which makes ctrl-d indeed the most obvious thing to try.

Ctrl + D works just fine without readline as well, so you don't even need that conclusion.

Re: Postgres 11 – A First Look

#128
post #88

Earlier quoted context omitted.

With Postgres you don't need MongoDB, InfluxDB, or any other trendy thing, Postgres does it all, and better than all the wannabes.

Could you please elaborate how to use Postgres as a time series database (like InfluxDB)?

Could you please elaborate how to use Postgres as a time series database (like InfluxDB)?

There's some good discussion of it here https://news.ycombinator.com/item?id=16539317

Re: Postgres 11 – A First Look

#129
post #88

Earlier quoted context omitted.

With Postgres you don't need MongoDB, InfluxDB, or any other trendy thing, Postgres does it all, and better than all the wannabes.

This is simply untrue. MongoDB is a much better JSON store. It's ridiculously faster, has much richer update semantics and it's simply not comparable when it comes to the ease of clustering. As for time series unless I am confused but PostgreSQL doesn't have any OOTB capabilities.

MongoDB is a much better JSON store

That hasn't been true for a long time, if it even ever really was when you consider that the key role of a database is to reliably persist your data https://www.enterprisedb.com/node/3441 (2014)

Re: Postgres 11 – A First Look

#130

I have a serious problem with Postgres. Every year at FOSDEM, some of the most technically interesting talks are about Postgres, and the room is always far too small so I can't get in.

Sounds like you need to VACUUM ANALYZE a few of the other attendees to make room ...
Post reply on HN