Live data from Hacker News

Postgres 11 – A First Look

craigkerstiens.com

11–20 of 193 posts

Re: Postgres 11 – A First Look

#11
post #10
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.

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.

Re: Postgres 11 – A First Look

#12
post #10
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.

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.

Re: Postgres 11 – A First Look

#13

Thank you pg maintainers, you've made such a wonderful thing.

It really is incredible how we can get something as fundamental as a database for free that is so well made and production ready. Can you imagine if there was no postgres? We'd have to use mysql or oracle or gasp mssql.

Re: Postgres 11 – A First Look

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

I don’t think this follows. I’ve been at multiple prompts that look like readline but aren’t.

Also ‘exit’ works in bash.

Re: Postgres 11 – A First Look

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

You're wrong. I think the bike shed should be blue.

;)

Re: Postgres 11 – A First Look

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

In a terminal in cooked mode, Ctrl+D sends EOF. Literally any program that reads from stdin and doesn't do something special to avoid it will handle Ctrl+D.

That's the point about why it's worth it to learn: It's universal to all terminal programs, even if the author of the program didn't know about it.

Re: Postgres 11 – A First Look

#17
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?

Re: Postgres 11 – A First Look

#18
post #15
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.

You're wrong. I think the bike shed should be blue. ;)

No GP is correct. Control-D sends an EOF (end of file) which indicates there is no more input.

This isn’t bike shedding at all as there’s a specific character code to indicate you’ve finished with a program and it’s standardized on all sane pieces of software. Heck it even works with things that aren’t specifically programmed to “exit” as they’ll simply end the stream on receipt.

Re: Postgres 11 – A First Look

#19
post #15
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.

You're wrong. I think the bike shed should be blue. ;)

This isn't really about alternatives. Bike shedding could be about exit-vs-quit or similar. Ctrl-d exists a layer above though. In a typical terminal / readline, your process will get an EOF / HUP signal which is treated like a clean-exit in most interactive cases and config-reload in many servers.

Just like ctrl-c generates INT and ctrl-z generates STP. This is worth learning.

Re: Postgres 11 – A First Look

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

Control+C is used to kill a process with the signal SIGINT, and can be intercepted by a program so it can clean its self up before exiting, or not exit at all. ... Ctrl+D means end of file. It has no effect if the program isn't reading input from the terminal. Ctrl+C means “interrupt”, i.e., stop what you're doing.
Post reply on HN