how to

start-on-mac-vscode

Mar 26, 2024
softwares-and-toolspostgresql
1 Minutes
97 Words

Install

ref: https://wiki.qiangyin.me:38080/s/12b24b4e-b01e-4a74-b318-4e97d89f415d

1
brew install postgresql@14
2
brew services start postgresql@14
3
createdb $USER

Make it run

ref: https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist

1
For MAC:
2
3
Install Homebrew
4
brew install postgres
5
initdb /usr/local/var/postgres
6
/usr/local/Cellar/postgresql/<version>/bin/createuser -s postgres or /usr/local/opt/postgres/bin/createuser -s postgres which will just use the latest version.
7
start postgres server manually: pg_ctl -D /usr/local/var/postgres start
8
To start server at startup
9
10
mkdir -p ~/Library/LaunchAgents
11
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
12
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
13
Now, it is set up, login using psql -U postgres -h localhost or use PgAdmin for GUI.
14
15
By default user postgres will not have any login password.
2 collapsed lines
16
17
Check this site for more articles like this: https://medium.com/@Nithanaroy/installing-postgres-on-mac-18f017c5d3f7

Vscode extension

Chris Kolkman’s PostgreSQL.

Article title:start-on-mac-vscode
Article author:Julyfun
Release time:Mar 26, 2024
Copyright 2025
Sitemap