This suppresses “ does not exist” errors that might otherwise be reported. IF EXISTS commands to drop objects in -clean mode. Routine dumps made for backup purposes should not use this option. Use the specified value of extra_float_digits when dumping floating-point data, instead of the maximum available precision. When using wildcards, be careful to quote the pattern if needed to prevent shell wildcard expansion. The pattern parameter is interpreted as a pattern according to the same rules used by psql's \d commands (see Patterns), so multiple databases can also be excluded by writing wildcard characters in the pattern. ![]() Multiple patterns can be excluded by writing multiple -exclude-database switches. exclude-database= patternĭo not dump databases whose name matches pattern. So, you should also specify a superuser name with -S, or preferably be careful to start the resulting script as a superuser. Presently, the commands emitted for -disable-triggers must be done as superuser. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data restore. It instructs pg_dumpall to include commands to temporarily disable triggers on the target tables while the data is restored. ![]() This option is relevant only when creating a data-only dump. This option disables the use of dollar quoting for function bodies, and forces them to be quoted using SQL standard string syntax. This will make restoration very slow it is mainly useful for making dumps that can be loaded into non- PostgreSQL databases. column-insertsĭump data as INSERT commands with explicit column names ( INSERT INTO table ( column. ![]() The behavior of the option may change in future releases without notice. Its use for other purposes is not recommended or supported. This option is for use by in-place upgrade utilities. Prevent dumping of access privileges (grant/revoke commands). The option is also passed down to pg_dump. Repeating the option causes additional debug-level messages to appear on standard error. This will cause pg_dumpall to output start/stop times to the dump file, and progress messages to standard error. (Usually, it's better to leave this out, and instead start the resulting script as superuser.) -tĭump only tablespaces, no databases or roles. This is relevant only if -disable-triggers is used. Specify the superuser user name to use when disabling triggers. sĭump only the object definitions (schema), not data. rĭump only roles, no databases or tablespaces. To make a script that can be restored by any user, but will give that user ownership of all the objects, specify -O. These statements will fail when the script is run unless it is started by a superuser (or the same user that owns all of the objects in the script). By default, pg_dumpall issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. Oĭo not output commands to set ownership of objects to match the original database. gĭump only global objects (roles and tablespaces), no databases. If this is omitted, the standard output is used. (Another way to get the same result is to set the PGCLIENTENCODING environment variable to the desired dump encoding.) -f filename By default, the dump is created in the database encoding. E encodingĬreate the dump in the specified character set encoding. If any of the objects do not exist in the destination cluster, ignorable error messages will be reported during restore, unless -if-exists is also specified. This option is useful when the restore is to overwrite an existing cluster. cĮmit SQL commands to DROP all the dumped databases, roles, and tablespaces before recreating them. See Section 34.16 for more information.ĭump only the data, not the schema (data definitions). It is convenient to have a ~/.pgpass file in such cases. If you use password authentication it will ask for a password each time. Pg_dumpall needs to connect several times to the PostgreSQL server (once per database). Use the -f/ -file option or shell operators to redirect it into a file. ![]() The SQL script will be written to the standard output. Also you will need superuser privileges to execute the saved script in order to be allowed to add roles and create databases. Since pg_dumpall reads tables from all databases you will most likely have to connect as a database superuser in order to produce a complete dump. pg_dumpall also dumps global objects that are common to all databases, namely database roles, tablespaces, and privilege grants for configuration parameters. It does this by calling pg_dump for each database in the cluster. The script file contains SQL commands that can be used as input to psql to restore the databases. Pg_dumpall is a utility for writing out ( “ dumping”) all PostgreSQL databases of a cluster into one script file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |