Postingan

Menampilkan postingan dari Juli, 2023

postgresql user/role

CREATE ROLE jonathan LOGIN; CREATE USER davide WITH PASSWORD 'jw8s0F4'; CREATE ROLE miriam WITH LOGIN PASSWORD 'jw8s0F4' VALID UNTIL '2005-01-01'; CREATE ROLE admin WITH CREATEDB CREATEROLE; CREATE USER testges WITH CREATEDB PASSWORD 'testges'; https://www.postgresql.org/docs/current/sql-createrole.html https://www.postgresql.org/docs/current/sql-createuser.html

postgresql import

psql --host=127.0.0.1 --username=postgres --password --dbname=mydb --file="/path/to/file/database.sql" lalu kamu akan dimintai password nya.

postgresql export database structures

pg_dump --username=postgres --schema-only --no-comments --no-owner --format=plain --file=./structures.sql mydb