This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| quickref:postgres [2025-11-07 Fri 19:02] – add constraint add/drop theorytoe | quickref:postgres [2026-11-19 Thu 03:33] (current) – demon-machine | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| CREATE DATABASE < | CREATE DATABASE < | ||
| CREATE ROLE < | CREATE ROLE < | ||
| - | ALTER USER backend | + | ALTER USER < |
| - | ALTER USER backend | + | ALTER USER < |
| ALTER DATABASE < | ALTER DATABASE < | ||
| GRANT ALL PRIVILEGES ON DATABASE < | GRANT ALL PRIVILEGES ON DATABASE < | ||
| Line 29: | Line 29: | ||
| ALTER TABLE < | ALTER TABLE < | ||
| ALTER TABLE < | ALTER TABLE < | ||
| + | </ | ||
| + | |||
| + | ===== Backup / Restore ===== | ||
| + | < | ||
| + | # Dump full db | ||
| + | pg_dump -U < | ||
| + | |||
| + | # Table, schema, or data only | ||
| + | pg_dump -U < | ||
| + | pg_dump -U < | ||
| + | pg_dump -U < | ||
| + | |||
| + | # Custom format (restore with pg_restore) | ||
| + | pg_dump -U < | ||
| + | |||
| + | # Restore | ||
| + | psql -U < | ||
| + | pg_restore -U < | ||
| </ | </ | ||