Live data from Hacker News

Postgres 11 – A First Look

craigkerstiens.com

21–30 of 193 posts

Re: Postgres 11 – A First Look

#21
post #4

I love PG. heaps better than the alternatives, for many reasons. My main one, is native IPv6 object support. I found the migration from 9.x to 10.x deeply painful, I think the one-time cost of the dump-restore cycle hurt me far more than I expected. I very much hope the transition to 11 can be done more expeditiously.

Have you tried pg_upgrade?

Yes. I still don't understand why it failed. It gave me a huge list of locale related reasons it felt unhappy, and since I hadn't selected a locale config option installing either the prior, or the current (9.4 -> 10.x) I felt pretty wierded out.

Re: Postgres 11 – A First Look

#22
post #3

> Now you can quit Postgres by simply typing quit or exit. Previously you had to use Ctrl + D or \q While this is good to help out beginners a bit, people should really learn Ctrl + D. It works practically everywhere and saves tons of time guessing/remembering and even typing the correct incantation for the program you want to exit.

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. There are a lot of ways to help others learn things like Ctrl + D, an even better experience might be a 1 second delay with a message informing them of other ways.

We could bikeshed all day on which is the more pristine way to exit a program, paint the shed whatever color you want, being intuitive for beginners is never a bad thing.

Re: Postgres 11 – A First Look

#23
post #3

> Now you can quit Postgres by simply typing quit or exit. Previously you had to use Ctrl + D or \q While this is good to help out beginners a bit, people should really learn Ctrl + D. It works practically everywhere and saves tons of time guessing/remembering and even typing the correct incantation for the program you want to exit.

What other apps use Ctrl+D ? I can't think of a single one.

python and node REPLs both do this.

Re: Postgres 11 – A First Look

#24
post #3

> Now you can quit Postgres by simply typing quit or exit. Previously you had to use Ctrl + D or \q While this is good to help out beginners a bit, people should really learn Ctrl + D. It works practically everywhere and saves tons of time guessing/remembering and even typing the correct incantation for the program you want to exit.

Oh no!

I used to be able to Ctrl+C knowing that it would interrupt any currently running query but never lose my session.

If I want to quit the PostgreSQL shell, I'd Ctrl+D like any other shell.

What will I do now?

Re: Postgres 11 – A First Look

#26
post #3

> Now you can quit Postgres by simply typing quit or exit. Previously you had to use Ctrl + D or \q While this is good to help out beginners a bit, people should really learn Ctrl + D. It works practically everywhere and saves tons of time guessing/remembering and even typing the correct incantation for the program you want to exit.

Oh no! I used to be able to Ctrl+C knowing that it would interrupt any currently running query but never lose my session. If I want to quit the PostgreSQL shell, I'd Ctrl+D like any other shell. What will I do now?

Ctrl-D still works. The new sql commands additions.

Re: Postgres 11 – A First Look

#28
post #7

Earlier quoted context omitted.

What other apps use Ctrl+D ? I can't think of a single one.

Any command-line that uses readline[0], which in practice is an absolute ton of things. This includes nodejs's repl, irb, ed, gdb, tftp, virsh, gpg --card-edit, and others. It also works for programs that read stdin as if it's a file if you're using a modern readline shell to run them (e.g. cat, tee, etc) [0]: https://en.wikipedia.org/wiki/GNU_Readline

It has nothing to do with readline, but is a feature of the TTY (i.e. implemented inside the kernel) when in canonical mode. It will work for anything that exits in reaction to read(STDIN_FILENO, ...) returning zero.

Re: Postgres 11 – A First Look

#29
One thing the OP didn’t mention is that the JIT is not enabled by default. They found that it has performance improvements for only long and complex queries yet. [1] But it can be enabled by a simple configuration command: jit = on.

[1]: https://www.phoronix.com/scan.php?page=news_item&px=PostgreS...

Re: Postgres 11 – A First Look

#30
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.

I learned about Ctrl + D pretty early on in my software career, probably around 2009 or so, and have been using it 99.99% of the time since then[1]. It's both consistent and easy, so I really can't see any benefit of not using it. [1] The 0.01% of the time was when I was testing out using Windows for software dev. I don't remember but I don't think Ctrl + D works there.

I find myself pressing ctrl+c on windows.
Post reply on HN