![]() 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. DROP commands for roles and tablespaces are added as well. Include SQL commands to clean (drop) databases 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 |