yum install postgresql-server systemctl enable postgresql postgresql-setup initdb systemctl start postgresql
vi /var/lib/pgsql/data/pg_hba.conf su - postgres psql \password postgres
CREATE USER (user); ?? GRANT ALL ON DATABASE postgres TO (user); \q logout
vi /var/lib/pgsql/data/pg_hba.conf
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/32 md5 host all all ::1/128 md5
tcp/5432
psql postgres
psql -h 0 --username=(user) postgres
\du list users: \password (user) change password ALTER USER (user) PASSWORD '(pass)';
CREATE USER (user) WITH PASSWORD '(user)123';
\l list \c connect \dg list database roles:
CREATE DATABASE "(dbname)" OWNER (user;
GRANT ALL ON DATABASE "(db)" TO (user);
\d show tables \d $table show columns of table
CREATE TABLE events();
ALTER TABLE events ADD COLUMN event_id bigint PRIMARY KEY;
ALTER TABLE events DROP COLUMN timestamp_start;
pg_dump --verbose -h 0 --username (user) -s -f (localfile-schema) "(dbname)" pg_dump --verbose -h 0 --username (user) "(dbname)" >> (localfile-data).backup
psql -h 0 --username (user) "(dbname)" < (dbname).backup
https://fedoraproject.org/wiki/PostgreSQL
????? // (domain)=# GRANT SELECT ON users TO PUBLIC;
Books: