

Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!


docker pull postgres docker run --name PostgreSQL - e POSTGRES_PASSWORD=postgres - d - p 5432:5432 postgres CONNECT ============================================== user (superuser): postgres pwd (custom): postgres port (default): 5432 database (superuser/maintenance): postgres CLI TOOLS ============================================== Command Description
psql - U postgres per connettere (con client psql) pg_dump backup db pg_dumpall backup cluster ossia +db pg_restore per importare pg_basebackup per creare snapshot fisici utili per la replica o il disaster recovery psql (poi) help help psql --help help \h help comandi sql ? help comandi psql \l lista databases \d lista relazioni (relation / relationship) \du lista ruoli \d
\q per uscire \c
\c dbname Connect to a database \dt List all tables in the current database \d tablename Describe the structure of a table \l List all databases \q Exit psql \conninfo Display information about the current connection \du List all roles \password Change the password for a role \x Toggle expanded table formatting ! command Execute a command in the shell \i filename Execute commands from a file \h Display help on SQL commands ? Display help on psql commands \set Set psql variables \unset Unset (delete) a psql variable \timing Toggle timing of commands \echo text Print text to the output \o filename Send query results to a file \s Display command history \watch Execute a query every specified interval WIN INSTALL (WIZARD) ============================================== components: