Live data from Hacker News

Postgres 11 – A First Look

craigkerstiens.com

61–70 of 193 posts

Re: Postgres 11 – A First Look

#61
post #58
post #55

Earlier quoted context omitted.

What syntax do you have in mind? Can you give sone example of what you see as easier in MySQL than Postgres? Genuinely curious, I don't have money in that game

I recall having to type /d from the command prompt to show databases (or something like that). I prefer “show databases”.

Haha, same. When I first used a postgres database, I got super annoyed trying to figure out how to simply show the databases and tables as I kept trying to use show and describe.

Re: Postgres 11 – A First Look

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

Where does it say that Ctrl-C handling has changed?

Re: Postgres 11 – A First Look

#63
post #37

Earlier quoted context omitted.

100% naive question: why is mysql and their similars so popular then? Spanner and AWS Aurora base off of more mysql than postregsql from what I can tell. Why?

I used both of them, but migrated to Postgres permanently a decade ago. Early on in my career, the biggest selling point for Mysql was the excellent web admin tool "phpMyAdmin" - it really helped get applications off the ground, since the core of most modern systems is the data model. Users could modify data, without your needing to create a UI for that use case. It conveniently used the same stack as the rest of the…

phpPgAdmin, started ~2002: http://phppgadmin.sourceforge.net/doku.php

Basically a port of phpMyAdmin to postgres. I used it for several years around ~2003-5.. it's nearly identical.

Re: Postgres 11 – A First Look

#64
post #37

A million things like this are why PostgreSQL is the only relational database I consider for, well, pretty much anything. Their approach of “build it safe and then make it fast” has been paying off in spades for a couple of decades now. Thanks for everything you do, psql maintainers!

100% naive question: why is mysql and their similars so popular then? Spanner and AWS Aurora base off of more mysql than postregsql from what I can tell. Why?

Historically postgres was slower than MySQL, harder to manage than MySQL, wasn't available on shared hosting and generally speaking wasn't beginner friendly. Because of this a generation of programmers learned MySQL, especially as everything PHP used MySQL. As such the install base for MySQL, was quite large so there were more potential customers for MySQL projects (WordPress, drupal and Joomla all run on mysql, so we're talking about 50% of websites before talking about custom applications)

Re: Postgres 11 – A First Look

#65
post #52
post #37

Earlier quoted context omitted.

100% naive question: why is mysql and their similars so popular then? Spanner and AWS Aurora base off of more mysql than postregsql from what I can tell. Why?

I’m no expert on this topic and have used both PG and MySQL. My preference is MySQL purely because the syntax is easier, or at least consistent with what I learned at uni in the late ‘90s. I also like MySQL workbench, although I’m sure there is an equivalent for PG I haven’t needed to look for one in recent years. If PG allowed me to use the same syntax as MySQL I’d probably switch, purely because experts and those w…

I recently mostly switched to Postgres from MySql, and using Postgres really points up some of the odd behavior / 'features' of MySql -- e.g., its parsing but not enforcing check constraints, "USE database_name," disinclination to handle JSON data, etc.

Also, Postgres' documentation is really fantastic. I bought a book on Postgres when I switched, but really I could have just stuck to the online manual and saved the thirty bucks.

I like many things about MySql [as you imply, syntax a bit more verbose but easier to remember - e.g. "SHOW TABLES" vs "\d" ; I also like the nonstandard behavior of MySql 'GROUP BY' as it makes good sense to me ]-- but overall I'm really enjoying the flexibility of Postgres. PGadmin4, on the other hand, leaves much to be desired -- I generally stick to psql.

Re: Postgres 11 – A First Look

#66
post #59

Earlier quoted context omitted.

CTRL+D works. You like it. Great use that. You don't think anybody needs an alternative? Or you don't think having an alternative will help at all? Fine. Think what you want. One thing's for (mostly) certain: it doesn't hurt. So there's really nothing to complain about.

> CTRL+D works. You like it. Great use that. You don't think anybody needs an alternative? Or you don't think having an alternative will help at all? Fine. Think what you want. One thing's for (mostly) certain: it doesn't hurt. So there's really nothing to complain about. Not complaining about its presence, as per my comment : "While I think it's great to have both options present,..." Just observing that claims of '…

You don't think it's intuitive for a command line application that is entirely driven by commands, there to be a command to exit it? Instead of a key combination? I'm used to Ctrl+D now, but it sure took me a while to figure it out. Are we not confusing intuitive with standardized?

Re: Postgres 11 – A First Look

#67
post #37

Earlier quoted context omitted.

100% naive question: why is mysql and their similars so popular then? Spanner and AWS Aurora base off of more mysql than postregsql from what I can tell. Why?

> Why? Notice that parallel to MySQL's rise a particular loosely-typed, never-except, often-wrong programming language also became popular. To this day I feed my family with that language. The typical coder (not that I do not say "developer") who codes in PHP does not care about correctness. He does not understand why monetary values cannot be stored in floats, he does not know what bitwise manipulation is, he does n…

In fairness, some of this is historical baggage that MySQL got stuck with from it's early popularity.

mSQL was a free/low cost SQL database in the early 90s. Originally it was an SQL translator built on top of Postgres (that used POSTQUEL). That was too slow (because Postgres had higher system requirements), so a new lightweight engine was developed for it.. and that's what later became MySQL. The point was a lightweight SQL database that ran well on cheap early-90s computers.

The compromises to make mSQL fast were inherited by MySQL, and they can't be easily changed without breaking the ecosystem that was developed around mSQL/MySQL.

Postgres on the other hand, was a university project in the 80s and 90s being developed on mainframes. It was always a slow moving, cautious project. Yes, it didn't make the compromises mSQL made, because it didn't have to. It used more memory, more CPU, but was more correct/safe than MySQL.

That was the same reason it lost in the 90s. mSQL was out being used by websites and other projects on cheap computers. Postgres was mostly waiting for computer tech to get fast enough so they wouldn't need to compromise their code too much to take it off the mainframe an on to cheaper computers. Postgres only adopted SQL in response to mSQL's popularity. Early Postgres was also harder to setup, another point that wasn't addressed until after mSQL took off.

MySQL was popular because of the compromises they made. If mSQL just kept Postgres as the engine, MySQL never would have existed. And if they instead waited (even a couple of years), and did things correctly, they wouldn't have beat Postgres -- which had a decade lead in development and was more advanced than mSQL/MySQL.

Re: Postgres 11 – A First Look

#68
post #57

What are some reasons I might consider Postgres over MySQL when choosing a DB platform?

If data is central to your business, in all likelihood it will be, and you care.

This is not a useful or constructive comment with its unstated argument of "only idiots use mysql". It's sarcastic flamewar bait.

Re: Postgres 11 – A First Look

#69
post #37

Earlier quoted context omitted.

100% naive question: why is mysql and their similars so popular then? Spanner and AWS Aurora base off of more mysql than postregsql from what I can tell. Why?

> Why? Notice that parallel to MySQL's rise a particular loosely-typed, never-except, often-wrong programming language also became popular. To this day I feed my family with that language. The typical coder (not that I do not say "developer") who codes in PHP does not care about correctness. He does not understand why monetary values cannot be stored in floats, he does not know what bitwise manipulation is, he does n…

This.

One also has to remember that long ago there was no serverless, no VPS/cloud/ec2/linode instances, no heroku/beanstalk/appengine, no docker/vagrant - to get going fast you had $x/mo shared hosting and [W|X]AMP for development, and this horrible thing called FTP. The only reasonable way to host a website cheaply was on some terrible shared hosting server which only [reasonably] supported php and mysql (okay I lie there was a cgi-bins and mod_perl) otherwise you'd be looking at dedicated servers.

Re: Postgres 11 – A First Look

#70
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 does Python do these days? I seem to remember it would catch common cases, but rather than quit, scold you and tell you how you should be doing it the other way, which seemed like the most Western European approach imaginable.

   Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
   Type "help", "copyright", "credits" or "license" for more information.

   >>> quit
   Use quit() or Ctrl-Z plus Return to exit

   >>> exit
   Use exit() or Ctrl-Z plus Return to exit
Post reply on HN