brew install postgresql
brew services start postgresql
psql postgres
\conninfo
| Connection info\q
| Exit psql connection\c
| Connect to a new database\dt
| List all tables\du
| List all roles\list
| List databases
CREATE ROLE richxcame WITH LOGIN PASSWORD 'your_password';
ALTER ROLE richxcame CREATEDB;
psql -d postgres -U richxcame
CREATE DATABASE m111;
CREATE TABLE users (
ID SERIAL PRIMARY KEY,
name VARCHAR(30),
email VARCHAR(30)
);
INSERT INTO users (name, email)
VALUES ('Baygeldi', '[email protected]'), ('John', '[email protected]');
SELECT * FROM users;