To specify which database server pg_dump should contact, use the command line options -h host and -p port. (If you do not have sufficient privileges to back up the entire database, you can still back up portions of the database to which you do have access using options such as -n schema or -t table.) In particular, it must have read access to all tables that you want to back up, so in order to back up the entire database you almost always have to run it as a database superuser. But remember that pg_dump does not operate with special permissions. This means that you can perform this backup procedure from any remote host that has access to the database. Pg_dump is a regular PostgreSQL client application (albeit a particularly clever one). While the above command creates a text file, pg_dump can create files in other formats that allow for parallelism and more fine-grained control of object restoration. We will see below how this can be useful. The basic usage of this command is:Īs you see, pg_dump writes its result to the standard output. PostgreSQL provides the utility program pg_dump for this purpose. The idea behind this dump method is to generate a file with SQL commands that, when fed back to the server, will recreate the database in the same state as it was at the time of the dump.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |