Difference between revisions of "PostgreSQL"
Jump to navigation
Jump to search
(createdb) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
==About== | ==About== | ||
{{seed}} | {{seed}} | ||
− | ==Commands== | + | ==Pages== |
+ | ===How To=== | ||
+ | * {{l/sub|admin}}: administration stuff | ||
+ | ===Commands=== | ||
* {{l/sub|createdb}} | * {{l/sub|createdb}} | ||
+ | * {{l/sub|createuser}} | ||
+ | * {{l/sub|dropuser}} | ||
+ | |||
==Links== | ==Links== | ||
* {{l/wp/ref}} | * {{l/wp/ref}} | ||
* [http://www.postgresql.org/ official] | * [http://www.postgresql.org/ official] | ||
** [https://www.postgresql.org/docs/current/static/backup-dump.html Chapter 25. Backup and Restore] | ** [https://www.postgresql.org/docs/current/static/backup-dump.html Chapter 25. Backup and Restore] | ||
+ | * [https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546 PostgreSQL command line cheatsheet] | ||
==Notes== | ==Notes== | ||
To backup a database: | To backup a database: | ||
* <code>su - postgres -c 'pg_dump {{arg|database name}} ' > {{arg|output_file.sql}}</code> | * <code>su - postgres -c 'pg_dump {{arg|database name}} ' > {{arg|output_file.sql}}</code> | ||
** Presumably "postgres" is the postgres "superuser"? Or it may be the user that "owns" the database, in which case change it to whatever is appropriate. | ** Presumably "postgres" is the postgres "superuser"? Or it may be the user that "owns" the database, in which case change it to whatever is appropriate. |
Latest revision as of 23:01, 7 November 2022
About
This page is a seed article. You can help HTYP water it: make a request to expand a given page and/or donate to help give us more writing-hours!
|
Pages
How To
- admin: administration stuff
Commands
Links
Notes
To backup a database:
su - postgres -c 'pg_dump <database name> ' > <output_file.sql>
- Presumably "postgres" is the postgres "superuser"? Or it may be the user that "owns" the database, in which case change it to whatever is appropriate.