mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Doc: clarify explanation of pg_dump usage.
This section confusingly used both "infile" and "outfile" to refer to the same file, i.e. the textual output of pg_dump. Use "dumpfile" for both cases, per suggestion from Jonathan Katz. Discussion: https://postgr.es/m/152311295239.31235.6487236091906987117@wrigleys.postgresql.org
This commit is contained in:
		@@ -35,7 +35,7 @@
 | 
				
			|||||||
   <xref linkend="app-pgdump"> for this purpose. The basic usage of this
 | 
					   <xref linkend="app-pgdump"> for this purpose. The basic usage of this
 | 
				
			||||||
   command is:
 | 
					   command is:
 | 
				
			||||||
<synopsis>
 | 
					<synopsis>
 | 
				
			||||||
pg_dump <replaceable class="parameter">dbname</replaceable> > <replaceable class="parameter">outfile</replaceable>
 | 
					pg_dump <replaceable class="parameter">dbname</replaceable> > <replaceable class="parameter">dumpfile</replaceable>
 | 
				
			||||||
</synopsis>
 | 
					</synopsis>
 | 
				
			||||||
   As you see, <application>pg_dump</> writes its result to the
 | 
					   As you see, <application>pg_dump</> writes its result to the
 | 
				
			||||||
   standard output. We will see below how this can be useful.
 | 
					   standard output. We will see below how this can be useful.
 | 
				
			||||||
@@ -109,9 +109,9 @@ pg_dump <replaceable class="parameter">dbname</replaceable> > <replaceable cl
 | 
				
			|||||||
    be read in by the <application>psql</application> program. The
 | 
					    be read in by the <application>psql</application> program. The
 | 
				
			||||||
    general command form to restore a dump is
 | 
					    general command form to restore a dump is
 | 
				
			||||||
<synopsis>
 | 
					<synopsis>
 | 
				
			||||||
psql <replaceable class="parameter">dbname</replaceable> < <replaceable class="parameter">infile</replaceable>
 | 
					psql <replaceable class="parameter">dbname</replaceable> < <replaceable class="parameter">dumpfile</replaceable>
 | 
				
			||||||
</synopsis>
 | 
					</synopsis>
 | 
				
			||||||
    where <replaceable class="parameter">infile</replaceable> is the
 | 
					    where <replaceable class="parameter">dumpfile</replaceable> is the
 | 
				
			||||||
    file output by the <application>pg_dump</> command. The database <replaceable
 | 
					    file output by the <application>pg_dump</> command. The database <replaceable
 | 
				
			||||||
    class="parameter">dbname</replaceable> will not be created by this
 | 
					    class="parameter">dbname</replaceable> will not be created by this
 | 
				
			||||||
    command, so you must create it yourself from <literal>template0</>
 | 
					    command, so you must create it yourself from <literal>template0</>
 | 
				
			||||||
@@ -141,7 +141,7 @@ psql <replaceable class="parameter">dbname</replaceable> < <replaceable class
 | 
				
			|||||||
    behavior and have <application>psql</application> exit with an
 | 
					    behavior and have <application>psql</application> exit with an
 | 
				
			||||||
    exit status of 3 if an SQL error occurs:
 | 
					    exit status of 3 if an SQL error occurs:
 | 
				
			||||||
<programlisting>
 | 
					<programlisting>
 | 
				
			||||||
psql --set ON_ERROR_STOP=on dbname < infile
 | 
					psql --set ON_ERROR_STOP=on dbname < dumpfile
 | 
				
			||||||
</programlisting>
 | 
					</programlisting>
 | 
				
			||||||
    Either way, you will only have a partially restored database.
 | 
					    Either way, you will only have a partially restored database.
 | 
				
			||||||
    Alternatively, you can specify that the whole dump should be
 | 
					    Alternatively, you can specify that the whole dump should be
 | 
				
			||||||
@@ -201,11 +201,11 @@ pg_dump -h <replaceable>host1</> <replaceable>dbname</> | psql -h <replaceable>h
 | 
				
			|||||||
    cluster, and also preserves cluster-wide data such as role and
 | 
					    cluster, and also preserves cluster-wide data such as role and
 | 
				
			||||||
    tablespace definitions. The basic usage of this command is:
 | 
					    tablespace definitions. The basic usage of this command is:
 | 
				
			||||||
<synopsis>
 | 
					<synopsis>
 | 
				
			||||||
pg_dumpall > <replaceable>outfile</>
 | 
					pg_dumpall > <replaceable>dumpfile</>
 | 
				
			||||||
</synopsis>
 | 
					</synopsis>
 | 
				
			||||||
    The resulting dump can be restored with <application>psql</>:
 | 
					    The resulting dump can be restored with <application>psql</>:
 | 
				
			||||||
<synopsis>
 | 
					<synopsis>
 | 
				
			||||||
psql -f <replaceable class="parameter">infile</replaceable> postgres
 | 
					psql -f <replaceable class="parameter">dumpfile</replaceable> postgres
 | 
				
			||||||
</synopsis>
 | 
					</synopsis>
 | 
				
			||||||
    (Actually, you can specify any existing database name to start from,
 | 
					    (Actually, you can specify any existing database name to start from,
 | 
				
			||||||
    but if you are loading into an empty cluster then <literal>postgres</>
 | 
					    but if you are loading into an empty cluster then <literal>postgres</>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user