4 ms·
Slightly irrelevant but I have always had terrible experiences with PostgreSQL on the CLI. To start off, it has extremely generic names for its binaries that ar
by ultimoo 13y ago
Slightly irrelevant but I have always had terrible experiences with PostgreSQL on the CLI. To start off, it has extremely generic names for its binaries that are installed on Linux -- `createuser` for example gives no indication that it handles user creation for PostgreSQL. This also means that I cannot do something like `pg-TAB-TAB` to find out all PostgreSQL relevant binaries that I can then invoke.
Apart form this, the OS X PostgreSQL installer I noticed had changed the ownership of the `/usr/local/bin` directory to itself, which was plain rude.
I'm largely new to PostgreSQL and it is quite possible that I'm using it all wrong, sorry for ranting.
- joevandyk 13y agoYes, I also have a problem with createuser vs adduser vs useradd. Also, dropdb, createdb, postgres, pg_ctl, initdb, pg_basebackup. No consistency.
- jeltz 13y agoI think it is a legacy issue. All the new executables are named with a pg_ prefix. Maybe someone should suggest a patch which renames the executables and adds symlinks from the old names. EDIT: There was a discussion and a patch 5 years ago, but I am not sure what was the final result other than that it was obviously not changed. http://www.postgresql.org/message-id/47EA5CC0.8040102@sun.com http://www.postgresql.org/message-id/47EA5CC0.8040102@sun.co...
- csmuk 13y agoI can't say that I've actually used any of those. You can do the same with CREATE [USER|SCHEMA|DATABASE] quite happily and ignore the rest. I tend not to use the CLI though as anything that presents a readline interface is a POS to work with when you have a verbose statement to type in. I'll type it out in VIM then throw the buffer through psql. I wouldn't run anything on OSX bar some Cocoa apps myself. Same with Windows. Everything Unixy happens inside a virtual machine. I don't care if OSX is Unix certified or Windows has cygwin - they're both a pain to deal with on a daily basis.
- pselbert 13y agoUsing \e within the psql shell will drop you right into your $EDITOR, which is likely vim. You can edit commands in there directly and they will be evaluated when you :wq out. The next time you type \e it will load the previous command back into the editor My only issue with this workflow is when I want to yank the command out to the clipboard. For some reason it doesn't seem to respect clipboard settings on OS X.