4 ms·
So I'm no database guru or anything, but I do spin up a database instance for projects from time to time. These days it's more likely to be SQLite rather than a
by spacedcowboy 3y ago
So I'm no database guru or anything, but I do spin up a database instance for projects from time to time. These days it's more likely to be SQLite rather than a multi-client one like MySQL or Postgres but it does still happen.
I choose Mysql every time, despite knowing that Postgres has been "better" historically for a few things. The reason is simple, I can get my shit done a lot faster in MySQL. I can type "SHOW TABLES" and ... see the tables, instead of looking up in the manual for whatever obscure escape sequence is required for Postgres. When I do a SELECT * in the shell, the default is a nicely formatted result that's easy for me to read. That's not my experience with Postgres.
I know that Postgres can do all these things, but I don't care - MySQL makes it easy, and that's one less thing to keep track of. Less barriers to entry == more times I'll use it.
Just my $0.02.
- justinclift 3y agoWell... kind of the point of using things like "\d" for displaying things from the cli is that it's a lot faster to type rather than "SHOW TABLES". So: \dt <-- shows tables \df <-- shows functions \dv <-- shows views (there's a large number of things like this, super useful if you use the PG cli a lot) \? <-- shows the help, including all of the various other \<stuff> commands Then again, tab completion is a thing too I guess for the MySQL cli as well. :)
- spacedcowboy 3y agoI don't disagree with any of that. My point is that I know sufficient SQL to do "stuff" in a database, and I don't have to go looking up documentation for \d when I'm using MySQL. SHOW DATABASES, SHOW TABLES is intuitive. \d (and being a unix guy, using \ rather than / is ... weird) is definitely not intuitive. Don't get me wrong, I've used Postgres when someone else has installed it for a project - it's a fine and capable database, and if I used it daily I'd probably get used to its syntax. It doesn't, however, seem to go out of its way to make things easier, IMHO. If you're going to have \dx as shortcuts for the typing-shy, then I don't see why you can't provide the more long-winded ones that don't require a manual lookup as well... I'm going to choose something that makes my life easier, when the line between one or the other choice is so fine - and MySQL is just ... easier.
- petre 3y agoI use both MySQL and Postgress. SHOW TABLES, SHOW CREATE TABLE, SHOW DATABASES is not SQL and takes too long to type. \dt, \df, \dv is very fast but I almost always mess up. I think SQLite's .tables, .schema, .databases is a good middle ground. OTOH we have many connections writing to the database to many tables, so one process per connection is not necessarily to our advantage. We're still using MyISAM to store time series data because it's fast. Maybe Aria is a better replacement. Too bad MySQL or MariaDB doesn't have a time series extension like Postgres' TimescaleDB and the GIS functions are quite basic. On MariaDB, some of the useful functions compare the bounding box instead of the actual shape¹. MySQL 8 is somewhat better in this regard². It's good enough to store POIs but not great to intersect a linestring to multiple polygons and get a useful distance. Also no LISTEN/NOTIFY mechanism in MySQL. 1. https://mariadb.com/kb/en/mysqlmariadb-spatial-support-matrix/ https://mariadb.com/kb/en/mysqlmariadb-spatial-support-matri... 2. https://dev.mysql.com/blog-archive/geography-in-mysql-8-0/ https://dev.mysql.com/blog-archive/geography-in-mysql-8-0/
- justinclift 3y ago> SHOW DATABASES, SHOW TABLES is intuitive. For you. You've learned that and managed to internalise it. For me, "\d<whatever>" is intuitive. :)
- paulryanrogers 3y ago> When I do a SELECT * in the shell, the default is a nicely formatted result that's easy for me to read. That's not my experience with Postgres. Both use pipe-delimited tables with spaces for padding, no? MySQL has \G for vertical (per query) and Psql has \x (toggle).
- spacedcowboy 3y agoThe last time I used Postgres (admittedly, installed by a colleague who was in charge of that project, so I'm not sure if she changed some option) I got one column per horizontal line ... Actually reading up on this, it looks like "\x on" was specified, possibly a default changed somewhere? I live in a world of 4K monitors, so I can pull a terminal very wide and see a lot of data at a glance, and this format didn't really mesh well with that. It's not a deal-breaker - mostly I connect via an API anyway, it's usually just debugging where I'm doing manual queries, but it's just one more niggle, and it might be something (in this case) to do with the database defaults.
- znpy 3y ago> The reason is simple, I can get my shit done a lot faster in MySQL. and that's a perfectly valid reason. unless you know for sure you need a specific tool, you should use whatever you're most comfortable with.
- themerone 3y agoSHOW TABLES is not a command in any of the database I work with. I would have to check the documentation if I was using MySQL.