606 CHAPTER 26 POSTGRESQL ADMINISTRATION Table 26-4.
606 CHAPTER 26 POSTGRESQL ADMINISTRATION Table 26-4. pg_dump Options (Continued) Option Explanation d, –inserts Dumps data using INSERT commands instead of COPY. Will slow restore. D, –column-inserts Specifies column names in INSERT commands. Even slower than d. f, –file=file Dumps output to the specified file rather than to standard out. F, –format=c|p|t Specifies the format for the dump: custom, plain-text, or tar-archive. i, –ignore-version Ignores version mismatch between the database and pg_dump. n, –schema=schema Dumps only the objects in the specified schema. o, –oids Includes OIDs with data for each row. Normally not needed. O, –no-owner Prevents commands to set object ownership. Used in plain-text dumps. s, –schema-only Dumps only the database schema, and not data. S, –superuser=username Specifies a superuser to use when disabling triggers. t, –table=table Dumps only the specified table. v, –verbose Produces verbose output in the dump file. x, –no-privileges, –no-acl Does not emit GRANT/REVOKE commands in the dump output. –disable-dollar-quoting Forces function bodies to be dumped with standard SQL string syntax. –disable-triggers Emits commands to disable triggers when loading data in plain-text dumps. Z, –compress=0…9 Sets the compression level to use in the custom dump format. Because there are quite a few options for pg_dump, let s take a look at some of the more common scenarios you may encounter when backing up your PostgreSQL database. The following command connects as the postgres user, dumps an archive of the mydb database in the custom archive format, and has that output redirected into the file called mydb.pgr: pg_dump -U postgres -Fc mydb > mydb.pgr The next command connects to a database called phppg running on a host called production, producing a schema-only dump, without owner information but with the commands to drop objects before creating them, in the file called production_schema.sql: pg_dump -h production -s -O -c -f production_schema.sql phppg
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.