4 ms·
As someone that is not a DBS expert, I like how easy it is to use PostgreSQL. Sure, you do need to conceptually know how a relational database works before you
by yes_or_gnome 11y ago
As someone that is not a DBS expert, I like how easy it is to use PostgreSQL. Sure, you do need to conceptually know how a relational database works before you jump into it's interactive CLI. But, once you have that knowledge, you can learn a lot about a particular database by knowing just one command. That is '\?'.
That hasn't been my experience with MySQL and other SQL-flavors, nor with the NoSQL projects like MongoDB and CouchDB.
- rockdoe 11y agoMySQL also had a usable commandline. Not sure it had shortcuts like \d+ etc though.
- rimantas 11y agoThis is what MySQL gives you for \?: List of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear (\c) Clear the current input statement. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Don't write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Don't show warnings after every statement. For server side help, type 'help contents'
- deckard1 11y agoI've always found MySQL's CLI vastly easier to use than PostgreSQL. The \G command alone is godsend. And the ASCII formatting makes everything much more readable to me.
- postila 11y agohave you tried "\x on" and "\x auto" in psql?
- agopaul 11y agoIn MySQL you append \G at the end of the query instead of ; to get the same result as \x. Weird I know, but it works. Still psql is a superior client IMHO.
- deckard1 11y agoyep. It's not the same at all. The format is harder to read, and the point of \G is you can do it without toggling. Say you run a query. Turns out, you need vertical format to see the entire contents. Just hit up arrow, replace the ';' at the end with '\G' and run the query again. MySQL also has \c which I find tremendously useful, when you screw something up mid-query.