🔧 Postgresql commands
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
Install postgresql
brew install postgresql@14
Start postgresql as a service
brew services start postgresql@14
Check if postgres is running
psql --version
If you don’t want PostgreSQL to run as a service, you can start it manually:
pg_ctl -D /opt/homebrew/var/postgres start
Stop the service
brew services stop postgres
Restart the service
brew services restart postgres
List all running services
brew services list
Login to postgres
psql postgres
Create User
CREATE ROLE app_user WITH LOGIN PASSWORD app_password;
Alter role
ALTER ROLE app_user CREATE_DB;
check all users
\du
Exit using CTRL+D
Login using new user
psql postgres -u app_user
create Database
CREATE DATABASE app_database
To check all databases
\l
connect to db
\connect app_database
list all tables
\dl
🔧 Postgresql commands
📈 19.06 Punkte
🔧 Programmierung
🔧 .Net ga kirish. Commands
📈 9.86 Punkte
🔧 Programmierung