PostgreSQL has specific command to get config details: pg_config To connect to PostgreSQL using command line, just type: psql postgres 1.4. 22:55:06.655 EEST LOG: database system is ready to accept connections 22:55:06.649 EEST LOG: database system was shut down at 22:55:02 EEST Now you can start PostgreSQL Server with command: pg-start waiting for server to start. Open current user’s bash profile: nano ~/.bash_profileĪdd following line to the end of the file: alias pg-start='brew services start postgresql'Īlias pg-stop='brew services stop postgresql'Īlias pg-restart='brew services restart postgresql'Īlias pg-status='pg_ctl -D /usr/local/var/postgres status' We can avoid using long commands to start, stop or restart postgresql service can create aliases in our user’s. You will get output like this: => Downloading If you ok with with that version than can install it with command: brew install postgresql In line #1 you can see version number: stable 11.2 and this is what we looked for. Or, if you don't want/need a background service you can just run: To have launchd start postgresql now and restart at login: To migrate existing data from a previous major version of PostgreSQL run: Postgres-xc (because postgresql and postgres-xc install the same binaries.) You will get output like this (valid for April 2019): postgresql: stable 11.2 (bottled), HEAD To check the version, we just need to run: brew info postgresql Check what is the latest version available
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |