33 lines
573 B
Plaintext
33 lines
573 B
Plaintext
# create user
|
|
create user wombat password 'secret';
|
|
|
|
# create database
|
|
create database dbaquaris;
|
|
|
|
# grant ALL privileges on a database to a user
|
|
grant all on database dbaquaris to wombat;
|
|
|
|
|
|
\c dbaquaris
|
|
grant all on schema public to wombat;
|
|
|
|
# connect
|
|
psql -h aquaris -U wombat -d dbaquaris;
|
|
|
|
# create schema
|
|
create schema bank;
|
|
|
|
# WAL archive status
|
|
select * from pg_stat_archiver;
|
|
|
|
select * from pg_ls_dir ('pg_wal/archive_status') ORDER BY 1;
|
|
|
|
# switch current WAL
|
|
select pg_switch_wal();
|
|
|
|
# show data directory
|
|
show data_directory;
|
|
|
|
# list databases with details
|
|
\l+
|