$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">update
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql-common -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql-common -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql-common -y
$ -weight: 600;">sudo /usr/share/postgresql-common/pgdg/-weight: 500;">apt.postgresql.org.sh
$ -weight: 600;">sudo /usr/share/postgresql-common/pgdg/-weight: 500;">apt.postgresql.org.sh
$ -weight: 600;">sudo /usr/share/postgresql-common/pgdg/-weight: 500;">apt.postgresql.org.sh
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql -y
$ -weight: 600;">sudo -weight: 500;">apt -weight: 500;">install postgresql -y
$ psql --version
$ psql --version
$ psql --version
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">enable postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">start postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">status postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">stop postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">stop postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">stop postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -u postgres psql
$ -weight: 600;">sudo -u postgres psql
$ -weight: 600;">sudo -u postgres psql
ALTER USER postgres WITH PASSWORD 'your_strong_password';
ALTER USER postgres WITH PASSWORD 'your_strong_password';
ALTER USER postgres WITH PASSWORD 'your_strong_password';
CREATE USER example_admin WITH PASSWORD 'secure_password';
\q
CREATE USER example_admin WITH PASSWORD 'secure_password';
\q
CREATE USER example_admin WITH PASSWORD 'secure_password';
\q
$ -weight: 600;">sudo nano /etc/postgresql/18/main/pg_hba.conf
$ -weight: 600;">sudo nano /etc/postgresql/18/main/pg_hba.conf
$ -weight: 600;">sudo nano /etc/postgresql/18/main/pg_hba.conf
local all postgres scram-sha-256
local all all scram-sha-256
local all postgres scram-sha-256
local all all scram-sha-256
local all postgres scram-sha-256
local all all scram-sha-256
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -weight: 500;">systemctl -weight: 500;">restart postgresql
$ -weight: 600;">sudo -u postgres psql
$ -weight: 600;">sudo -u postgres psql
$ -weight: 600;">sudo -u postgres psql
CREATE DATABASE example_store OWNER example_admin;
GRANT ALL PRIVILEGES ON DATABASE example_store TO example_admin;
\q
CREATE DATABASE example_store OWNER example_admin;
GRANT ALL PRIVILEGES ON DATABASE example_store TO example_admin;
\q
CREATE DATABASE example_store OWNER example_admin;
GRANT ALL PRIVILEGES ON DATABASE example_store TO example_admin;
\q
$ psql -U example_admin -d example_store -h localhost
$ psql -U example_admin -d example_store -h localhost
$ psql -U example_admin -d example_store -h localhost
CREATE TABLE products ( product_id SERIAL PRIMARY KEY, product_name VARCHAR(100) NOT NULL, category VARCHAR(100), price NUMERIC(10, 2)
); INSERT INTO products (product_name, category, price) VALUES ('Widget A', 'Hardware', 9.99), ('Widget B', 'Software', 29.99), ('Widget C', 'Services', 49.99); SELECT * FROM products;
\q
CREATE TABLE products ( product_id SERIAL PRIMARY KEY, product_name VARCHAR(100) NOT NULL, category VARCHAR(100), price NUMERIC(10, 2)
); INSERT INTO products (product_name, category, price) VALUES ('Widget A', 'Hardware', 9.99), ('Widget B', 'Software', 29.99), ('Widget C', 'Services', 49.99); SELECT * FROM products;
\q
CREATE TABLE products ( product_id SERIAL PRIMARY KEY, product_name VARCHAR(100) NOT NULL, category VARCHAR(100), price NUMERIC(10, 2)
); INSERT INTO products (product_name, category, price) VALUES ('Widget A', 'Hardware', 9.99), ('Widget B', 'Software', 29.99), ('Widget C', 'Services', 49.99); SELECT * FROM products;
\q - Use PostgreSQL as the database layer in a web application with Django or Rails
- Set up streaming replication for high availability
- Automate backups with pg_dump and a cron job