Postingan

Menampilkan postingan dengan label postgresql

postgresql import csv

\copy transaksi FROM '/path/to/import.csv' WITH DELIMITER AS ';' NULL AS 'NULL' CSV HEADER

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

Cara Ganti Password PostgreSQL pada Debian/Ubuntu (CLI)

$ sudo -u postgres psql -p 5433 # jika port beda $ sudo -u postgres psql # \password postgres # \q Tested on Debian 11/bullseye (unstable). (referensi) https://stackoverflow.com/a/12721020/3036312

Laptop kentang saya punya 3 server PostgreSQL berbeda

Cara mengetahui Informasi Tables/Views PostgreSQL

select * from information_schema.tables a where a.table_catalog = 'YOUR_DB_NAME' -- optional and a.table_schema != 'information_schema' and a.table_schema not like 'pg_%' and a.table_type = 'BASE TABLE' -- table and a.table_type = 'VIEW' -- view

cara mengatasi gagal instalasi PostgreSQL di Windows

Gambar