4 ms·
psql. It's installed everywhere I need to use it, it reads from stdin, and it writes to stdout. It's often the case that I want to take a SQL query that I've de
by kmstout 6y ago
psql. It's installed everywhere I need to use it, it reads from stdin, and it writes to stdout. It's often the case that I want to take a SQL query that I've developed, generalize it a bit, and use something like
psql OPTIONS <<EOF
SELECT ...
EOF
in a shell script (probably wrapped in a function for convenience).
- Justsignedup 6y agoto be fair. psql is not only available everywhere, but with a well customized .psqlrc file you can really get that tool to do what you want it to do. On rare occasions I still need a GUI tool to explore a database because GUI definitely wins during the exploration phase by a lot. Ironically enough for report writing I use metabase web ui. it serves most purposes I need from it.
- lukeschlather 6y agoWhat does your .psqlrc look like? I keep meaning to look into wrangling readline and getting history working well.
- e12e 6y agoI do use psql for scripting, but for more interactive use, pgcli is quite nice too: https://www.pgcli.com/ https://www.pgcli.com/ It doesn't help with visualizing schemas, however.
- iameoghan 6y agoOoh, that looks interesting (even though it doesn't do visual schemas as you say)
- bmdavi3 6y ago+1. Be sure to add \x auto and \timing to your ~/.psqlrc file to make the experience even better!