doc-exports/docs/dws/tool/dws_07_0101.html
Lu, Huayi 27019c2991 DWS TOOL 830.201 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:35:25 +00:00

294 lines
111 KiB
HTML

<a name="EN-US_TOPIC_0000001188362608"></a><a name="EN-US_TOPIC_0000001188362608"></a>
<h1 class="topictitle1">gs_dump</h1>
<div id="body32001227"><div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s9ae443d9100f4337a35876c8aa21d661"><h4 class="sectiontitle">Context</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p589185483411"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b11967444185317">gs_dump</strong> is tool provided by <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text1106431371">GaussDB(DWS)</span> to export database information. You can export a database or its objects, such as schemas, tables, and views. The database can be the default <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270615502">postgres</strong> database or a user-specified database.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p203823882615">When <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1628215238415">gs_dump</strong> is used to export data, other users can still access the database (readable or writable).</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p025617309813"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1975036854">gs_dump</strong> can export complete, consistent data. For example, if <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b27614253513">gs_dump</strong> is started to export database A at T1, data of the database at that time point will be exported, and modifications on the database after that time point will not be exported.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac9a65ced2ab84f44badfb704b55ee2ab"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b174471458380">gs_dump</strong> can export database information to a plain-text SQL script file or archive file.</p>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ul43152121719"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li336251710">Plain-text SQL script: It contains the SQL statements required to restore the database. You can use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b11797145516417">gsql</strong> to execute the SQL script. With only a little modification, the SQL script can rebuild a database on other hosts or database products.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li1151515102310">Archive file: It contains data required to restore the database. It can be a tar-, directory-, or custom-format archive. For details, see <a href="#EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_teb56550d78ba40669508ee8a78bce1bc">Table 1</a>. The export result must be used with <a href="dws_07_0103.html#EN-US_TOPIC_0000001188521068">gs_restore</a> to restore the database. The system allows you to select or even to sort the content to import.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_sf2e329c5aeb04c57ba9c438246a8178e"><h4 class="sectiontitle">Functions</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac7ae249d6da44ed8b39642657bf861cc"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1499991015615">gs_dump</strong> can create export files in four formats, which are specified by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b2014118564">-F</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b161211115616">--format=</strong>, as listed in <a href="#EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_teb56550d78ba40669508ee8a78bce1bc">Table 1</a>.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_teb56550d78ba40669508ee8a78bce1bc"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_teb56550d78ba40669508ee8a78bce1bc"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_teb56550d78ba40669508ee8a78bce1bc" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Formats of exported files</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_r1349b5a185b14be0ab75e84c0bf84690"><th align="left" class="cellrowborder" valign="top" width="12.78%" id="mcps1.3.2.3.2.6.1.1"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad93519bc53ed4eb7974146a076b7aad8">Format</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.8%" id="mcps1.3.2.3.2.6.1.2"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p4587167183616">Value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b767744993019">-F</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.78%" id="mcps1.3.2.3.2.6.1.3"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a1d424831af904e5fa0c34726ee504512">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.65%" id="mcps1.3.2.3.2.6.1.4"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p6978831508">Suggestion</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.990000000000002%" id="mcps1.3.2.3.2.6.1.5"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p2063187163819">Corresponding Import Tool</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_re4d486523793493e996addc068ebe759"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.2.3.2.6.1.1 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a44e8e7ea635b4dfeac4524f0a647e422">Plain-text</p>
</td>
<td class="cellrowborder" valign="top" width="9.8%" headers="mcps1.3.2.3.2.6.1.2 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p859110714363">p</p>
</td>
<td class="cellrowborder" valign="top" width="30.78%" headers="mcps1.3.2.3.2.6.1.3 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1374812518463">A plain-text script file containing SQL statements and commands. The commands can be executed on <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b19159536133615">gsql</strong>, a command line terminal, to recreate database objects and load table data.</p>
</td>
<td class="cellrowborder" valign="top" width="20.65%" headers="mcps1.3.2.3.2.6.1.4 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p130319266504">You are advised to use plain-text export files for small databases.</p>
</td>
<td class="cellrowborder" valign="top" width="25.990000000000002%" headers="mcps1.3.2.3.2.6.1.5 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p18632714386">Before using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b20189728204318">gsql</strong> to restore database objects, you can use a text editor to edit the exported plain-text file as required.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_row14339208493"><td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.3.2.3.2.6.1.1 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4296ab087f904a1a83859751dacb9d8f">Custom</p>
</td>
<td class="cellrowborder" valign="top" width="9.8%" headers="mcps1.3.2.3.2.6.1.2 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p16594177133618">c</p>
</td>
<td class="cellrowborder" valign="top" width="30.78%" headers="mcps1.3.2.3.2.6.1.3 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p2018045019462">A binary file that allows the restoration of all or selected database objects from an exported file.</p>
</td>
<td class="cellrowborder" valign="top" width="20.65%" headers="mcps1.3.2.3.2.6.1.4 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p205841643165011">You are advised to use custom-format archive files for medium or large database.</p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="25.990000000000002%" headers="mcps1.3.2.3.2.6.1.5 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p146377143811">You can use <a href="dws_07_0103.html#EN-US_TOPIC_0000001188521068">gs_restore</a> to import database objects from a custom-format archive.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_row1377584264920"><td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.1 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a41f9f71f6c1b41959b66a55512e3b581">Directory</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.2 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p155963793619">d</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.3 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p141347125538">A directory containing directory files and the data files of tables and BLOB objects.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.4 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p430501165117">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_re9cacbfde47e4d25a62bda817a35b558"><td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.1 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad0e1a17910eb40ccaa8355b34baddb65">.tar</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.2 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p10597975361">t</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.3 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p27801606479">A tar-format archive that allows the restoration of all or selected database objects from an exported file. It cannot be further compressed and has an 8-GB limitation on the size of a single table.</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.3.2.3.2.6.1.4 "><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p8184143515">-</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ne65788eddc8d48e3af2630a70763903e"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_adee186ed8433493bb4fe7b5a34d52235">To reduce the size of an exported file, you can use the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103029">gs_dump</strong> tool to compress it to a plain-text file or custom-format file. By default, a plain-text file is not compressed when generated. When a custom-format archive is generated, a medium level of compression is applied by default. Archived exported files cannot be compressed using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103023">gs_dump</strong>.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s63de8a3df950468d9651f75a441f8387"><h4 class="sectiontitle">Precautions</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4128c60ee1ed4a31ae3fb74abc937461">Do not modify an exported file or its content. Otherwise, restoration may fail.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a1a98e046985d469d99225db2ad02bdab">To ensure the data consistency and integrity, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103044">gs_dump</strong> acquires a share lock on a table to be dumped. If another transaction has acquired a share lock on the table, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103059">gs_dump</strong> waits until this lock is released and then locks the table for dumping. If the table cannot be locked within the specified time, the dump fails. You can customize the timeout duration to wait for lock release by specifying the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103121">--lock-wait-timeout</strong> parameter.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s3bd41ca2df98484a81b5a4c3fe566002"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_sb84086ab734a4a999eb7cb1f641bd7e8">gs_dump [<em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a6502cbc500fa41868b4a49e5c103c859">OPTION</em>]... [<em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a1a81cdfa2bda4e9e92a63c249f432a2b">DBNAME</em>]</pre>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_neba4bef5827d47df8bdfebc4a0975531"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a63af6792f5054fc3867808bd8bd1caa9"><em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_i55075893192230">DBNAME</em> does not follow a short or long option. It specifies the database to connect to.</p>
<p class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a29418fb9328043229f44c5be7275079d">For example:</p>
<p class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad46af3b4b5ce4e29a0b352bdb2a4609e">Specify <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_i4021289119239">DBNAME</em> without a <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b186889277513">-d</strong> option preceding it.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s1956042be7eb4adeafda64631ee75f47"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac227e479b8054bec97690e0d974edd8e">gs_dump </strong>-p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4a472590b8474b0699ceb5ff78b4aecc">port_number</em> postgres -f dump1.sql</pre>
<p class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_af8bdb0a970b14f44adb0d49936605af7">or</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_se055a912fa884763a90b0dad5014c07b">export PGDATABASE=postgres </pre>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s17206468c07b424bbf6689f68d2cbf14"> <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4b98e9ceb39344a4b237ddd43b751a9d">gs_dump</strong> -p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa8bd9d3a2a004c9fa5a2148e13dded19">port_number</em> -f dump1.sql</pre>
<p class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a38610fca7bbb4c22894859bdb91c1397">Environment variable: <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i2412410181913">PGDATABASE</em></p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s86679fec588b45698acf2bde40c9b516"><h4 class="sectiontitle">Parameter Description</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a14e3883c6d04415b8d2ff0eb99351962">Common parameters:</p>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_u6e6d6e82bd20413da1c38bff45d264d9"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l0b461ddc3bea4e8686d34f27ed4a0d8e">-f, --file=FILENAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac972b070035e4324b3e4548942a72fab"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l0b461ddc3bea4e8686d34f27ed4a0d8e"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l0b461ddc3bea4e8686d34f27ed4a0d8e"></a>Sends the output to the specified file or directory. If this parameter is omitted, the standard output is generated. If the output format is <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151250">(-F c/-F d/-F t)</strong>, the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270615130">-f</strong> parameter must be specified. If the value of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151327">-f</strong> parameter contains a directory, the directory has the read and write permissions to the current user.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc4144bda57a64848bc9ea52bf8c12ba2">-F, --format=c|d|t|p<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_adfa665ddd3d248b094f0b810bc4165a4"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc4144bda57a64848bc9ea52bf8c12ba2"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc4144bda57a64848bc9ea52bf8c12ba2"></a>Selects the exported file format. Its format can be:</p>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_u14a8c09a38484abeae50ac2b771b2d30"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ldced3d8798cb46fe8cde027c751aa45f"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706152259">p|plain</strong>: Generates a text SQL script file. This is the default value.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lef2fe1796803481d8d893acb3f57ef1f"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b87551919970">c|custom</strong>: Outputs a custom-format archive as a directory to be used as the input of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706102733">gs_restore</strong>. This is the most flexible output format in which users can manually select it and reorder the archived items during the restore process. An archive in this format is compressed by default.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lafcb1cf8c0014631a98ad05655115adf">d|directory: A directory containing directory files and the data files of tables and BLOB objects.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_en-us_topic_0059777770_li25619089348">t|tar: Outputs a tar format as the archive form that is suitable for the input of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_en-us_topic_0058968121_b84235270615490">gs_restore</strong>. The .tar format is compatible with the directory format. Extracting a .tar archive generates a valid directory-format archive. However, the .tar archive cannot be further compressed and has an 8-GB limitation on the size of a single table. The order of table data items cannot be changed during restoration.<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aeb5e5c0fe574458a84c5433e19289d32">A .tar archive can be used as input of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162858">gsql</strong>.</p>
</li></ul>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l45f75969bd9e4ccba60f6209257a4da9">-v, --verbose<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ab86aeaa4dba34086924530ce06a5a468"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l45f75969bd9e4ccba60f6209257a4da9"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l45f75969bd9e4ccba60f6209257a4da9"></a>Specifies the verbose mode. If it is specified, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706154932">gs_dump</strong> writes detailed object comments and the number of startups/stops to the dump file, and progress messages to standard error.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l150d43abc6b24086b800bd69f2cc9343">-V, --version<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a92e220c517054d3a858f80c5f3e775f5"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l150d43abc6b24086b800bd69f2cc9343"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l150d43abc6b24086b800bd69f2cc9343"></a>Prints the <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_i735023819511">gs_dump</em> version and exits.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lee5f6671b595445dbebb56d893710aec">-Z, --compress=0-9<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad1d087f29c274428873163c45d6e1155"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lee5f6671b595445dbebb56d893710aec"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lee5f6671b595445dbebb56d893710aec"></a>Specifies the used compression level.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aee3d25240408469e9116e50b3dc2cc05">Value range: 0 to 9</p>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_uf8ac0ffd431849a3895d6c7022bf2e0c"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l04ef0ce29b734a9eaa1e23e6c33e194c"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616458">0</strong> indicates no compression.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l177baeb962284c8ebcb057b65daa7c96"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706164514">1</strong> indicates that the compression ratio is the lowest and processing speed the fastest.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l00c9f7b94c4e4693819b42016b311117"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270617939">9</strong> indicates the compression ratio is the highest and processing speed the slowest.</li></ul>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a81daab82b0934b7aaf26530cc73a5141">For the custom-format archive, this option specifies the compression level of a single table data segment. By default, data is compressed at a medium level. Setting the non-zero compression level will result in that the entire text output files are to be compressed, as if the text has been compressed using the gzip tool, but the default method is non-compression. The .tar archive format does not support compression currently.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4aad5b8830674b248b01a325e51426a2">--lock-wait-timeout=TIMEOUT<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a595caba693e941059970b48437021674"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4aad5b8830674b248b01a325e51426a2"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4aad5b8830674b248b01a325e51426a2"></a>Do not keep waiting to obtain shared table locks at the beginning of the dump. Consider it as failed if you are unable to lock a table within the specified time. The timeout duration can be specified in any of the formats accepted by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616436">SET statement_timeout</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf683780ace2449c0ac021d36c152734c">-?, --help<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a92656a9f091f435ba64ee411cfebb89f"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf683780ace2449c0ac021d36c152734c"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf683780ace2449c0ac021d36c152734c"></a>Shows help about <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706114121">gs_dump</strong> parameters and exits.</p>
</li></ul>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac625617b7b4249818c9079811582dc5c">Dump parameters:</p>
</div>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_uce3269f2ca9742cf9b79211035eea1dc"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ldff3e912abed4996b09ab2d42543ccde">-a, --data-only<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_af5b73e545d104e0bab928ddbc048480a"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ldff3e912abed4996b09ab2d42543ccde"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_ldff3e912abed4996b09ab2d42543ccde"></a>Generates only the data, not the schema (data definition). Dumps the table data, big objects, and sequence values.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7fcae47298ef4ebe844f6df26bdf9136">-b, --blobs<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a9953347ba7044211b2ba65ac3e919f77"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7fcae47298ef4ebe844f6df26bdf9136"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7fcae47298ef4ebe844f6df26bdf9136"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l493042eadb9d4cb1954fb40200c4c074">-c, --clean<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a2ace259039904a74acc0de86c96e25a7"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l493042eadb9d4cb1954fb40200c4c074"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l493042eadb9d4cb1954fb40200c4c074"></a>Before writing the command of creating database objects into the backup file, write the command of clearing (deleting) database objects to the backup files. (If no objects exist in the target database, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706104228">gs_restore</strong> probably displays some error information.)</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a98301b3929dd43b496b5e8cff9c2766d">This parameter is used only for the plain-text format. For the archive format, you can specify the option when using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706165935">gs_restore</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l757826bcd8bd4cb1ab52f81847ae2e4d">-C, --create<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_abc8c3092dcf748d483f6c69a047d92f7"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l757826bcd8bd4cb1ab52f81847ae2e4d"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l757826bcd8bd4cb1ab52f81847ae2e4d"></a>The backup file content starts with the commands of creating the database and connecting to the created database. (If the script is in this format, any database to be connected is allowed before running the script.)</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a8cda7499dc6246dabd3389645c54807f">This parameter is used only for the plain-text format. For the archive format, you can specify the option when using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1607058518">gs_restore</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5bf8cf3fe7ed4904b9a97c70dc0cab90">-E, --encoding=ENCODING<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a9a87dc9d529944ce83d75f6491e26a6a"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5bf8cf3fe7ed4904b9a97c70dc0cab90"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5bf8cf3fe7ed4904b9a97c70dc0cab90"></a>Creates a dump file in the specified character set encoding. By default, the dump file is created in the database encoding. (Alternatively, you can set the environment variable <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706142624">PGCLIENTENCODING</strong> to the required dump encoding.)</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2edfade1e42b4102ac3bbf96beaf5138">-n, --schema=SCHEMA<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a17ed38251b3041eea1f4208c29bab2bc"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2edfade1e42b4102ac3bbf96beaf5138"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2edfade1e42b4102ac3bbf96beaf5138"></a>Dumps only schemas matching the schema names. This option contains the schema and all its contained objects. If this option is not specified, all non-system schemas in the target database will be dumped. Multiple schemas can be selected by specifying multiple <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b4500171018195">-n</strong> options. The schema parameter is interpreted as a pattern according to the same rules used by the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270614330">\d</strong> command of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706193434">gsql</strong>. Therefore, multiple schemas can also be selected by writing wildcard characters in the pattern. When you use wildcards, quote the pattern to prevent the shell from expanding the wildcards.</p>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_n6d4864b3a59042e68d23355f32d76127"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_u279f1965bb6d49bbb2d3971340f3be4f"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l21a88163e340424a8e8e3a06d5ac54b6">If <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b195056102194">-n</strong> is specified, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706104459">gs_dump</strong> does not dump any other database objects that the selected schemas might depend upon. Therefore, there is no guarantee that the results of a specific-schema dump can be automatically restored to an empty database.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l917bf558b9c045db83721756ceee3d2b">If <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b25071710151915">-n</strong> is specified, the non-schema objects are not dumped.</li></ul>
</div></div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad3be0b27c5f5446ea34a3ff4fe959c27">Multiple schemas can be dumped. Entering <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b11220610309">-n </strong><em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_i821522304">schemaname</em> multiple times dumps multiple schemas.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac9bd87070f794a11a9869eead726d13d">For example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s7890c4bc0c514e15968d8fd26bae993a">gs_dump -h <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a419a20f1461846e08f5347e676e68dd4">host_name </em>-p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a07a9b686ad9a4faf9e3a9f5d794dbd3b">port_number</em> postgres -f <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a2e8aecab8b7a42548ffba511de840bac">backup/bkp_shl2.sql</em> -n <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a33e9c8949835451fbad25fda4cdd64a4">sch1 </em>-n <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a488a6b29f09942ffbe59cff369949f32">sch2</em></pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a800198b011594ac78e2a307937d5bf20">In the preceding example, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706144456">sch1</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706144459">sch2</strong> are dumped.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1a725fe4f5014fc395afd7ce79c6b60e">-N, --exclude-schema=SCHEMA<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a29dad14471474cb39a2f538f978880eb"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1a725fe4f5014fc395afd7ce79c6b60e"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1a725fe4f5014fc395afd7ce79c6b60e"></a>Does not dump any tables matching the table pattern. The pattern is interpreted according to the same rules as for <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b7520111081911">-n</strong>. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b165201010201913">-N</strong> can be specified multiple times to exclude schemas matching any of the specified patterns.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac08012541d28487fad9144914d0c4e14">When both <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b652111015193">-n</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b9522510111912">-N</strong> are specified, the schemas that match at least one <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1952212106199">-n</strong> option but no <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b135221510151911">-N</strong> is dumped. If <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b95222010101914">-N</strong> is specified and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1652216106192">-n</strong> is not, the schemas matching <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b852271091918">-N</strong> are excluded from what is normally dumped.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a667e2d80e80c4b14ae683b85d5216650">Dump allows you to exclude multiple schemas during dumping.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a594cc5d46a5249b9943d05bc238af52b">Specifies <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103857">-N exclude schema name</strong> to exclude multiple schemas while dumping.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4d48f9c9975f4430ad2773ab0109ecee">For example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_sa4e71427c95841eb837f2b01639fdb1a">gs_dump -h <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a2abbc821e8d148839a1bc8231f54fc31">host_name </em>-p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a5427ec5c563645448560ccfc0e6108fd">port_number</em> postgres -f <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4b377f77db9646f9afb23a170d4eaefc">backup/bkp_shl2.sql</em> -N <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aee8473ce660c4b6f94d382ce472690b5">sch1 </em>-N <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_abe5d172fd9cb461b8c63953440143242">sch2</em></pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a9adce382df374d88a2484f84c13d41f4">In the preceding example, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b830910566">sch1</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b295480332">sch2</strong> will be excluded during the dumping.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l73c3b38285204d23a40e45a19abebb36">-o, --oids<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a04893494db4341b18c1c002caf247781"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l73c3b38285204d23a40e45a19abebb36"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l73c3b38285204d23a40e45a19abebb36"></a>Dumps object identifiers (OIDs) as parts of the data in each table. Use this parameter if your application references the OID columns in some way (for example, in a foreign key constraint). If the preceding situation does not occur, do not use this parameter.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l593085ea3dd640e781654277c10b398e">-O, --no-owner<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a7e98a262fd344692b8db673d4cce809e"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l593085ea3dd640e781654277c10b398e"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l593085ea3dd640e781654277c10b398e"></a>Do not output commands to set ownership of objects to match the original database. By default, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706152612">gs_dump</strong> issues the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b653514102197">ALTER OWNER</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b165352010181914">SET SESSION AUTHORIZATION</strong> command to set ownership of created database objects. These statements will fail when the script is running unless it is started by a system administrator (or the same user that owns all of the objects in the script). To make a script that can be stored by any user and give the user ownership of all objects, specify <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b8535141001911">-O</strong>.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a831c40c97f9e4a87963f10f3eab38768">This parameter is used only for the plain-text format. For the archive format, you can specify the option when using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1696801554">gs_restore</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5"></a>-s, --schema-only<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a850a1f2138a24bc2bf618377feb617b1"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5"></a>Dumps only the object definition (schema) but not data.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l17d8463b33874356aa1900b20fc2124b">-S, --sysadmin=NAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ab7a0d847e0ca47bdb5a8c2a6ce4d9fc2"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l17d8463b33874356aa1900b20fc2124b"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l17d8463b33874356aa1900b20fc2124b"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4d1d2fc1876d4d779af266e5e6f0f588">-t, --table=TABLE<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a5715a36dd8294abb88a3ce765be2a1d4"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4d1d2fc1876d4d779af266e5e6f0f588"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4d1d2fc1876d4d779af266e5e6f0f588"></a>Specifies a list of tables, views, sequences, or foreign tables to be dumped. You can use multiple <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103025">-t</strong> parameters or wildcard characters to specify tables.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a196a4ce0f6504b0c82779d59b8725aa6">When using wildcards to specify dump tables, quote the pattern to prevent the shell from expanding the wildcards.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4ee40b8e295847039fd3b57266e627b1">The <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b45481710131919">-n</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1054821071913">-N</strong> options have no effect when <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b12548151014195">-t</strong> is used, because tables selected by using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b13548610101920">-t</strong> will be dumped regardless of those options, and non-table objects will not be dumped.</p>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_n7fa6e38550884137bbbb80da078dae15"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p28343343113331">The number of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1470945367162213">-t</strong> parameters must be less than or equal to 100.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1169776115151">If the number of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b73929053162232">-t</strong> parameters is greater than 100, you are advised to use the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162244">--include-table-file</strong> parameter to replace some <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b433593223162320">-t</strong> parameters.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p6211366711457">If <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b15521410181919">-t</strong> is specified, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706154819">gs_dump</strong> does not dump any other database objects that the selected tables might depend upon. Therefore, there is no guarantee that the results of a specific-table dump can be automatically restored to an empty database.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a703f39473c4d470996d49ef1eb45823e"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706155839">-t tablename</strong> only dumps visible tables in the default search path. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b8423527061610">-t '*.tablename'</strong> dumps <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_i122001102329">tablename</em> tables in all the schemas of the dumped database. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616148">-t schema.table</strong> dumps tables in a specific schema.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p227611539543"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b08276418137">-t tablename</strong> does not export the trigger information from a table.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a06b48125fd774943b40ba45664b9f1a5">For example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s6d2d6df6324a483586d882859d7efba2">gs_dump -h <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a26ddf98aa25d40a495e26cf3c87b04e3">host_name</em> -p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a231e8fb6528148bd8d6472bce2c368ce">port_number </em>postgres -f <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a6ccdceeb51fd47e6ac4e124dfa5ad6e9">backup/bkp_shl2.sql</em> -t <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a811bbd76226141ccb4577d9d3df981f3">schema1.table1</em> -t <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a6772881c283241f2bd84cbf275cc45f9">schema2.table2</em></pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a6d469532da144815a31a969bb2b8ca7e">In the preceding example, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162452">schema1.table1</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162456">schema2.table2</strong> are dumped.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li2376121914115">--include-table-file=FILENAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p173781919194116"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li2376121914115"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_li2376121914115"></a>Specifies the table file to be dumped.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2e577612ec8d4299b87624810ffbe399">-T, --exclude-table=TABLE<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4ed9ce73f4c1447b889a35dc7cf1e84c"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2e577612ec8d4299b87624810ffbe399"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l2e577612ec8d4299b87624810ffbe399"></a>Specifies a list of tables, views, sequences, or foreign tables not to be dumped. You can use multiple <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b207303244817031">-t</strong> parameters or wildcard characters to specify tables.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a74c85a7dea0545bea8466176cd2ba61f">When <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103231">-t</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103240">-T</strong> are input, the object will be stored in <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270610337">-t</strong> list not <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103320">-T</strong> table object. </p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ae78efa74602d4e3296597b2beda78b14">For example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s9a41b3ba9b7c4e0e8a9d7271e53899dc">gs_dump -h <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a60d18f313cb74329b20278c7b49b86cb">host_name </em>-p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aff8b29f4b4cd4af7a4122b15d18c82b3">port_number </em>postgres -f <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a886a45d020b0420abe219bace699115c">backup/bkp_shl2.sql</em> -T <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a307c74e60bfd45378fd04d297e8b25b6">table1 </em>-T <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a2fcc7b860a5347cfbf7dc949827c544d">table2</em></pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a29d93e37c1484037b2aff1c9496f4d5a">In the preceding example, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1637313043">table1</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b661015151">table2</strong> are excluded from the dumping.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li1660943284211">--exclude-table-file=FILENAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p6611193224217"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li1660943284211"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_li1660943284211"></a>Specifies the table file to be dumped.</p>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_note5405317412027"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1671652312027">Same as <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616249">--include-table-file</strong>, the content format of this parameter is as follows:</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p45070950121823">schema1.table1</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p39098989121836">schema2.table2</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p60809933121845">...</p>
</div></div>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l56fd2555fd7d474b9031fb75ecdd261f">-x, --no-privileges|--no-acl<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a3cda1a7f611c40e2a251281eae66168b"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l56fd2555fd7d474b9031fb75ecdd261f"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l56fd2555fd7d474b9031fb75ecdd261f"></a>Prevents the dumping of access permissions (grant/revoke commands).</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6610d570f5c0492c9a21a1e6a550ae1c">--column-inserts|--attribute-inserts<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa08dfc2071844f309902d4770cb296e1"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6610d570f5c0492c9a21a1e6a550ae1c"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6610d570f5c0492c9a21a1e6a550ae1c"></a>Exports data by running the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b959491011190">INSERT</strong> command with explicit column names {INSERT INTO table (column, ...) VALUES ...}. This will cause a slow restoration. However, since this option generates an independent command for each row, an error in reloading a row causes only the loss of the row rather than the entire table content.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7c1595f32bfa4976ac829a2c93610872">--disable-dollar-quoting<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a10bb215d5f364915a650ff6213846c9e"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7c1595f32bfa4976ac829a2c93610872"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l7c1595f32bfa4976ac829a2c93610872"></a>Disables the use of dollar sign ($) for function bodies, and forces them to be quoted using the SQL standard string syntax.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lede0b7fcb73e446faa4fed18c60f7b12">--disable-triggers<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a21fdb41b466d41bdb18c017c1f7e0e85"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lede0b7fcb73e446faa4fed18c60f7b12"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lede0b7fcb73e446faa4fed18c60f7b12"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l85cd49e8e3274324abb2bcedb8c46c2e">--exclude-table-data=TABLE<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a78fb05025e7745908279c7868aa8a885"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l85cd49e8e3274324abb2bcedb8c46c2e"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l85cd49e8e3274324abb2bcedb8c46c2e"></a>Does not dump data that matches any of table patterns. The pattern is interpreted according to the same rules as for <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b25991310131919">-t</strong>.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac4266d058e04499c877ae35d95ed89e1"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706103816">--exclude-table-data</strong> can be entered more than once to exclude tables matching any of several patterns. When the user needs the specified table definition rather than data in the table, this option is helpful.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aac568bd7c519478895e9b8c3e906ce01">To exclude data of all tables in the database, see <a href="#EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l95dba45fc0df4807a8b924830aafbaf5">--schema-only</a>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf9b5e1015c8d4a25aa6e13372bb06e65">--inserts<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a62a0b9359a42436dba062b5b9b3d74d7"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf9b5e1015c8d4a25aa6e13372bb06e65"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf9b5e1015c8d4a25aa6e13372bb06e65"></a>Dumps data when the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b16062106199">INSERT</strong> statement (rather than <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b206061210141915">COPY</strong>) is issued. This will cause a slow restoration.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_afb03ca4a7ad24605ac8fcc599a11369c">However, since this option generates an independent command for each row, an error in reloading a row causes only the loss of the row rather than the entire table content. The restoration may fail if you rearrange the column order. The <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b56083102194">--column-inserts</strong> option is unaffected against column order changes, though even slower.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf6f8af6ed81a4427830452109a9e3aef">--no-security-labels<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a284f69a219574e40b97088f0893814f2"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf6f8af6ed81a4427830452109a9e3aef"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf6f8af6ed81a4427830452109a9e3aef"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l69119b8d0d5f4d0386f619fb1799ac3b">--no-tablespaces<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a3b5acff5871d4d248828071279485a89"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l69119b8d0d5f4d0386f619fb1799ac3b"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l69119b8d0d5f4d0386f619fb1799ac3b"></a>Does not issue commands to select tablespaces. All the objects will be created during the restoration process, no matter which tablespace is selected when using this option.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_af50e9149313b486bbb7507916272a960">This parameter is used only for the plain-text format. For the archive format, you can specify the option when using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b816603182">gs_restore</strong>.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l361e8c9ca1134d0d8aa489c59635807a">--no-unlogged-table-data<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a8d7eb069923e4148866462c9b1ac783c"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l361e8c9ca1134d0d8aa489c59635807a"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l361e8c9ca1134d0d8aa489c59635807a"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l950a11105ad34614a8b88503cb764513">--non-lock-table<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a3ab53f45ed814b358d799ba1ee4f3c6e"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l950a11105ad34614a8b88503cb764513"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l950a11105ad34614a8b88503cb764513"></a>Specifies a reserved port for function expansion. This parameter is not recommended.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l99c2769ab3af4df1a179ec431d12ddc5">--quote-all-identifiers<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a5512fd74ef1d44a1bb1ad9d2c7e25ae3"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l99c2769ab3af4df1a179ec431d12ddc5"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l99c2769ab3af4df1a179ec431d12ddc5"></a>Forcibly quotes all identifiers. This parameter is useful when you dump a database for migration to a later version, in which additional keywords may be introduced.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1600f07f5d0644f19694f6404fcdc01e">--section=SECTION<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad97bb1f09aec4ae4b3f15093e0bbf0de"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1600f07f5d0644f19694f6404fcdc01e"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1600f07f5d0644f19694f6404fcdc01e"></a>Specifies dumped name sections (pre-data, data, or post-data).</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l9db37f4fdcf043709f615b2892927873">--serializable-deferrable<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a5faf398e5aad470d980ce40b1585154b"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l9db37f4fdcf043709f615b2892927873"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l9db37f4fdcf043709f615b2892927873"></a>Uses a serializable transaction for the dump to ensure that the used snapshot is consistent with later database status. Perform this operation at a time point in the transaction flow, at which everything is normal. This ensures successful transaction and avoids serialization failures of other transactions, which requires serialization again.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a5d37f8b56f69469fbc6eb2a3d87087d2">This option has no benefits for disaster recovery. During the upgrade of the original database, load a database copy as a report or other shared read-only dump is helpful. The option does not exist, dump reveals a status which is different from the submitted sequence status of any transaction.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a0da2e9c7b43e42be9eb8a74ca5f74c00">This option will make no difference if there are no active read-write transactions when <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706111834">gs_dump</strong> is started. If the read-write transactions are in active status, the dump start time will be delayed for an uncertain period.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lcdddf5618cff4f9784165674d7402ebc">--use-set-session-authorization<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a05276671a724467a9e21bb2aa2093124"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lcdddf5618cff4f9784165674d7402ebc"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lcdddf5618cff4f9784165674d7402ebc"></a>Specifies that the standard SQL <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b11909328102710">SET SESSION AUTHORIZATION</strong> command rather than <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b391012812712">ALTER OWNER</strong> is returned to ensure the object ownership. This makes dumping more standard. However, if a dump file contains objects that have historical problems, restoration may fail. A dump using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b12961532112711">SET SESSION AUTHORIZATION</strong> requires the system administrator rights, whereas <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b122961932102716">ALTER OWNER</strong> requires lower permissions.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l3afa4ebda6f44f399280c84ae137de69">--with-encryption=AES128<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a97eddc5fe77b47d596596b3dbf9edb39"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l3afa4ebda6f44f399280c84ae137de69"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l3afa4ebda6f44f399280c84ae137de69"></a>Specifies that dumping data needs to be encrypted using AES128.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lac7429f7b38a4d108f369714eac854b1">--with-key=KEY<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4df016846d7c4bb9a4eae2c543457272"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lac7429f7b38a4d108f369714eac854b1"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lac7429f7b38a4d108f369714eac854b1"></a>Specifies that the key length of AES128 must be 16 bytes.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbb7ee390db224cd09c7144e8a101c79d">--include-nodes<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa13cc0048c3f4c069a3c9c88b5c024bc"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbb7ee390db224cd09c7144e8a101c79d"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbb7ee390db224cd09c7144e8a101c79d"></a>Includes the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162457">TO NODE</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616257">TO GROUP</strong> statement in the dumped <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162512">CREATE TABLE</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162521">CREATE FOREIGN TABLE</strong> statement. This parameter is valid only for HDFS and foreign tables.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6720a7a77375405c8f96aacfbe1e88c7">--include-extensions<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ab589fb2d39b94c3bbf6bd7007274bd9f"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6720a7a77375405c8f96aacfbe1e88c7"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l6720a7a77375405c8f96aacfbe1e88c7"></a>Includes extensions in the dump.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li10126814103311">--include-depend-objs<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p24032464103311"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li10126814103311"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_li10126814103311"></a>Includes information about the objects that depend on the specified object in the backup result. This parameter takes effect only if the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162747">-t</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706162756">--include-table-file</strong> parameter is specified.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li25147785103315">--exclude-self<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p25003480103315"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li25147785103315"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_li25147785103315"></a>Excludes information about the specified object from the backup result. This parameter takes effect only if the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b211198203">-t</strong> or <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1099060448">--include-table-file</strong> parameter is specified.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5a182ad189cf475cbcc7692d0d2f930b">--dont-overwrite-file<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a18833c295c0b4521a5bf879f4f82d2c4"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5a182ad189cf475cbcc7692d0d2f930b"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5a182ad189cf475cbcc7692d0d2f930b"></a>The existing files in plain-text, .tar, and custom formats will be overwritten. This parameter is not used for the directory format.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac89dc1996fe44de9bd4d4fecc7fa05bb">For example:</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_en-us_topic_0059777770_p147937469478">Assume that the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706205216">backup.sql</strong> file exists in the current directory. If you specify <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706205236">-f backup.sql</strong> in the input command, and the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706205251">backup.sql</strong> file is generated in the current directory, the original file will be overwritten.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a632b5afc4e954594a5e748ae02ca7c27">If the backup file already exists and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b93415351123">--dont-overwrite-file</strong> is specified, an error will be reported with the message that the dump file exists.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s364852a7298e4ce98a641a518e3d4e26">gs_dump -p <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a07dd03be788f42aba513b1ad55241789">port_number </em>postgres -f <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a0a807ac9298948049820364ff9a604ec">backup.sql</em> -F <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a99af68bd9e1e4f969c0f0298c445af09">plain </em>--dont-overwrite-file</pre>
</li></ul>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ndc41db057b574fd4b6382c18a9f21319"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_u238fa5dde2a648339323177fb625cbcf"><li class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l1e8a359109394174be6cade2cb6d6be0">The <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1874535132716">-s/--schema-only</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b18874935172714">-a/--data-only</strong> parameters do not coexist.</li><li class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l78a5ba61f0354bdc8c5bc135df988cc3">The <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706114846">-c/--clean</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706114855">-a/--data-only</strong> parameters do not coexist.</li><li class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lae6198fea53d492ab9d30325326f1409"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115149">--inserts/--column-inserts</strong> and <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115158">-o/--oids</strong> do not coexist, because <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706204543">OIDS</strong> cannot be set using the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115240">INSERT</strong> statement.</li><li class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l5b9617b9647645a4aeb943b79f68ee5c"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270611541">--role</strong> must be used in conjunction with <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115417">--rolepassword</strong>.</li><li class="text" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lf7ded4ee55fe4ad99dd9308e81982eb1"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115436">--binary-upgrade-usermap</strong> must be used in conjunction with <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706115447">--binary-upgrade</strong>.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li1029723212206"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616304">--include-depend-objs</strong>/<strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163012">--exclude-self</strong> takes effect only when <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163029">-t</strong>/<strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163034">--include-table-file</strong> is specified.</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li19899995122035"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b351354556">--exclude-self </strong>must be used with <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270616293">--include-depend-objs</strong>.</li></ul>
</div></div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a2db4ae9e0137437ba9cfceddbc0d1a04">Connection parameters:</p>
<ul id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_u577750c92d1b474281b73cae85165fd2"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc3085939657a4485938845ea4c93321f">-h, --host=HOSTNAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa12534375b8f40a2bad20cac6c6aad3a"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc3085939657a4485938845ea4c93321f"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lc3085939657a4485938845ea4c93321f"></a>Specifies the host name. If the value begins with a slash (/), it is used as the directory for the UNIX domain socket. The default is taken from the PGHOST environment variable (if available). Otherwise, a Unix domain socket connection is attempted.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a29555ae842404d3fa0a04b777195fa30">This parameter is used only for defining names of the hosts outside a cluster. The names of the hosts inside the cluster must be 127.0.0.1.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a7c996e29899e42aa898aba883ee63025">Example: the host name</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4fcef72bd1c54c40a87d422fdb424121">Environment Variable: <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i2568191291914">PGHOST</em></p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l694d20570457403fa4ca11fcf4dfd637">-p, --port=PORT<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aefa642fc6d7c475197c9e8533f8f5c12"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l694d20570457403fa4ca11fcf4dfd637"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l694d20570457403fa4ca11fcf4dfd637"></a>Specifies the host port.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a652ca591543444ef9a64af13da74b384">Environment variable: <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i11570181221912">PGPORT</em></p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l094718c436a543348032f3299b87a7e0">-U, --username=NAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ae6d8cee40a8248459bf41fc9cdc2aae9"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l094718c436a543348032f3299b87a7e0"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l094718c436a543348032f3299b87a7e0"></a>Specifies the user name of the host to connect to.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a7568aa4c295f46f8a8347c10857bca27">Environment variable: <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i205751612111910">PGUSER</em></p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4190ce7a07b74a28a619b230023237df">-w, --no-password<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ad7401761f2a8489aa61577875a7ae6d5"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4190ce7a07b74a28a619b230023237df"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l4190ce7a07b74a28a619b230023237df"></a>Never issue a password prompt. The connection attempt fails if the host requires password verification and the password is not provided in other ways. This parameter is useful in batch jobs and scripts in which no user password is required.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbce5e7172c9a4390a526dda0d431ecf8">-W, --password=PASSWORD<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_af01bcf84c2664f9d89f07cf6c97aa0ed"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbce5e7172c9a4390a526dda0d431ecf8"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_lbce5e7172c9a4390a526dda0d431ecf8"></a>Specifies the user password to connect to. If the host uses the trust authentication policy, the administrator does not need to enter the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1458091217193">-W</strong> option. If the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b185805121190">-W</strong> option is not provided and you are not a system administrator, the Dump Restore tool will ask you to enter a password.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l94b039144ab748dd842eda8eb494666b">--role=ROLENAME<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a26a6128a460f4b078f97c0b5a155adba"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l94b039144ab748dd842eda8eb494666b"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l94b039144ab748dd842eda8eb494666b"></a>Specifies a role name to be used for creating the dump. If this option is selected, the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b11581191214195">SET ROLE</strong> command will be issued after the database is connected to <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151531">gs_dump</strong>. It is useful when the authenticated user (specified by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b758121231911">-U</strong>) lacks the permissions required by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151723">gs_dump</strong>. It allows the user to switch to a role with the required permissions. Some installations have a policy against logging in directly as a system administrator. This option allows dumping data without violating the policy.</p>
</li><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l531e016403d94742a29598e0faa08cd6">--rolepassword=ROLEPASSWORD<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa271be5111494e88b542f7358ff2e698"><a name="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_l531e016403d94742a29598e0faa08cd6"></a><a name="en-us_topic_0000001188680980_en-us_topic_0000001099130242_l531e016403d94742a29598e0faa08cd6"></a>Password for the role</p>
</li></ul>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_sb5cbbac5af5b451ea20e7391fc57b888"><h4 class="sectiontitle">Description</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p9501143484614"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b114401131133117">Scenario 1</strong></p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aaea3e98895694d68ba3f653d792a1a4e">If your database cluster has any local additions to the template1 database, restore the output of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b84235270615204">gs_dump</strong> into an empty database with caution. Otherwise, you are likely to obtain errors due to duplicate definitions of the added objects. To create an empty database without any local additions, copy data from template0 rather than template1. Example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_scfca6b252b7d4134b9a26a601611c8e5">CREATE DATABASE foo WITH TEMPLATE template0;</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a44b751c966974d54b4795eb11de08b4f">The .tar format file size must be smaller than 8 GB. (This is the tar file format limitations.) The total size of a .tar archive and any of the other output formats are not limited, except possibly by the OS.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ac5d8c59eebf741728fbf129a93eb508c">The dump file generated by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706152411">gs_dump</strong> does not contain the statistics used by the optimizer to make execution plans. Therefore, you are advised to run <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706204929">ANALYZE</strong> after restoring from a dump file to ensure optimal performance. The dump file does not contain any <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151313">ALTER DATABASE ... SET</strong> commands; these settings are dumped by <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706151318">gs_dumpall</strong>, along with database users and other installation settings.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p810312429460"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b6502193743113">Scenario 2</strong></p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p6501244174615">When the value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b105056554316">SEQUENCE</strong> reaches the maximum or minimum value, backing up the value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1543912863214">SEQUENCE</strong> using <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b113911210328">gs_dump</strong> will exit due to an execution error. Handle the problem by referring to the following example:</p>
<ol id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ol1212514191466"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li0125141913460">The value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b16850134211346">SEQUENCE</strong> reaches the maximum value, but the maximum value is less than <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b5176758133419">2^63-2</strong>.</li></ol>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p19999056202511">Error message example:</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p46198814166">Object defined by sequence</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen74013314165">CREATE SEQUENCE seq INCREMENT 1 MINVALUE 1 MAXVALUE 3 START WITH 1;</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p091183891217">Perform the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b96821911103610">gs_dump</strong> backup.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1348484231614">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text1788984714144">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i167111444172612">{password}</em> -p 37300 postgres -t PUBLIC.seq -f backup/MPPDB_backup.sql
gs_dump[port='37300'][postgres][2019-12-27 15:09:49]: The total objects number is 337.
gs_dump[port='37300'][postgres][2019-12-27 15:09:49]: WARNING: get invalid xid from GTM because connection is not established
gs_dump[port='37300'][postgres][2019-12-27 15:09:49]: WARNING: Failed to receive GTM rollback transaction response for aborting prepared (null).
gs_dump: [port='37300'] [postgres] [archiver (db)] [2019-12-27 15:09:49] query failed: ERROR: Can not connect to gtm when getting gxid, there is a connection error.
gs_dump: [port='37300'] [postgres] [archiver (db)] [2019-12-27 15:09:49] query was: RELEASE bfnextval</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1387994912161">Handling procedure:</p>
<div class="p" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p10012420419">Run the following SQL statement to connect to the PostgreSQL database and change the maximum value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b245619264379">sequence seq1</strong>:<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen20841227202119">gsql -p 37300 postgres -r -c "ALTER SEQUENCE PUBLIC.seq MAXVALUE 10;"</pre>
</div>
<div class="p" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1776213435417">Use the dump tool to back up the data.<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen14278175562215">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text136282049610">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i11758114183116">{password}</em> -p 37300 postgres -t PUBLIC.seq -f backup/MPPDB_backup.sql
gs_dump[port='37300'][postgres][2019-12-27 15:10:53]: The total objects number is 337.
gs_dump[port='37300'][postgres][2019-12-27 15:10:53]: [100.00%] 337 objects have been dumped.
gs_dump[port='37300'][postgres][2019-12-27 15:10:53]: dump database postgres successfully
gs_dump[port='37300'][postgres][2019-12-27 15:10:53]: total time: 230 ms</pre>
</div>
<ol start="2" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_ol4125191912464"><li id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_li7125161914465">The value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b74482061384">SEQUENCE</strong> reaches the minimum or the maximum value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b0732348183814">2^63-2</strong>.</li></ol>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p2935174131415">The <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1493033133912">gs_dump</strong> command does not support backup of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b9461843913">SEQUENCE</strong> value in this scenario.</p>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_note32121574248"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p2021218573249">The SQL end does not support the modification of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b62061534103912">MAXVALUE</strong> when <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b113630413394">SEQUENCE</strong> reaches the maximum value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b18549104819398">2^63-2</strong> or the modification of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b14877185533910">MINVALUE</strong> when <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b3748105973914">SEQUENCE</strong> reaches the minimum value.</p>
</div></div>
</div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1184035441512"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b6786162718517">Scenario 3</strong></p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p240516201618"><strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1333671920717">gs_dump</strong> is mainly used to export metadata of the entire database. The performance of exporting a single table is optimized, but the performance of exporting multiple tables is poor. If multiple tables need to be exported, you are advised to export them one by one. Example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen18722153163612">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text18995347064">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i2035134583116">{password}</em> -p 37300 postgres -t public.table01 -s -f backup/table01.sql
gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text114651854860">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i1351748193120">{password}</em> -p 37300 postgres -t public.table02 -s -f backup/table02.sql</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p21351930237">When services are stopped or during off-peak hours, you can increase the value of <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b14536123214816">--non-lock-table</strong> to improve the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b574741492">gs_dump</strong> performance. Example:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1558619411256">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text138358246618">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i1495335093119">{password}</em> -p 37300 postgres -t public.table03 -s --non-lock-table -f backup/table03.sql</pre>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s969fde25c47f45ed897e29d208d57649"><h4 class="sectiontitle">Examples</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a21ea7ac2811f463792e409427f4748dc">Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706111455">gs_dump</strong> to dump a database as a SQL text file or a file in other formats.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a03678d5db83d4e28b860af6caaecd4a7">In the following examples, <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b1223684420201">password</strong> indicates the password configured by the database user. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b18236114482017">backup/MPPDB_backup.sql</strong> indicates an exported file where <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b8236044192015">backup</strong> indicates the relative path of the current directory. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b142366442207">37300</strong> indicates the port ID of the database server. <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_b523664442019">postgres</strong> indicates the name of the database to be accessed.</p>
<div class="note" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_n06c8e237a9e54c57aaee5c8bf2d8cc34"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a699012b7a7794d6481e611a255a467ff">Before exporting files, ensure that the directory exists and you have the read and write permissions on the directory.</p>
</div></div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a86a5b51fac5f4553b801996e6e3a015a">Example 1: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b45111409542">gs_dump</strong> to export the full information of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b36521750185412">postgres</strong> database. The exported <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b838649125512">MPPDB_backup.sql</strong> file is in plain-text format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen3557319995254">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text860418313535">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i149639552313">{password}</em> -f backup/MPPDB_backup.sql -p 37300 postgres -F p
gs_dump[port='37300'][postgres][2018-06-27 09:49:17]: The total objects number is 356.
gs_dump[port='37300'][postgres][2018-06-27 09:49:17]: [100.00%] 356 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-27 09:49:17]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-27 09:49:17]: total time: 1274 ms</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aba0b3a4e53924c099708519a48606f09">Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b17418336145513">gsql</strong> to import data from the export plain-text file.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a4cb505d87a1446e79adf2026f469583c">Example 2: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1181825735514">gs_dump</strong> to export the full information of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1381825715519">postgres</strong> database. The exported <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b13834205716555">MPPDB_backup.tar</strong> file is in .tar format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1151581210350">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text1334265281517">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i114061559103120">{password}</em> -f backup/MPPDB_backup.tar -p 37300 postgres -F t
gs_dump[port='37300'][postgres][2018-06-27 10:02:24]: The total objects number is 1369.
gs_dump[port='37300'][postgres][2018-06-27 10:02:53]: [100.00%] 1369 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-27 10:02:53]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-27 10:02:53]: total time: 50086 ms</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_aa33afd590bb94ab0867917c65a45b531">Example 3: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b813918745717">gs_dump</strong> to export the full information of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b17827511105712">postgres</strong> database. The exported <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1256131516576">MPPDB_backup.dmp</strong> file is in custom format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1567584710324">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text16311258111514">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i143287218328">{password}</em> -f backup/MPPDB_backup.dmp -p 37300 postgres -F c
gs_dump[port='37300'][postgres][2018-06-27 10:05:40]: The total objects number is 1369.
gs_dump[port='37300'][postgres][2018-06-27 10:06:03]: [100.00%] 1369 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-27 10:06:03]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-27 10:06:03]: total time: 36620 ms</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_abaeb1c76f2b247aca5fab4a3f7e8d212">Example 4: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b10714154177">gs_dump</strong> to export the full information of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b197141141472">postgres</strong> database. The exported <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b206208301717">MPPDB_backup</strong> file is in directory format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen49076093101457">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text4799194181611">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i12610512322">{password}</em> -f backup/MPPDB_backup -p 37300 postgres -F d
gs_dump[port='37300'][postgres][2018-06-27 10:16:04]: The total objects number is 1369.
gs_dump[port='37300'][postgres][2018-06-27 10:16:23]: [100.00%] 1369 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-27 10:16:23]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-27 10:16:23]: total time: 33977 ms </pre>
</div>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p1263012597344">Example 5: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1731240670">gs_dump</strong> to export the information of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1211194615720">postgres</strong> database, excluding the information of the table specified in the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b19465139180">/home/MPPDB_temp.sql</strong> file. The exported <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b1676985110920">MPPDB_backup.sql</strong> file is in plain-text format.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen56745774103658">gs_dump -U <span id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_text8613104655517">dbadmin</span> -W <em id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_i114978793212">{password}</em> -p 37300 postgres --exclude-table-file=/home/MPPDB_temp.sql -f backup/MPPDB_backup.sql
gs_dump[port='37300'][postgres][2018-06-27 10:37:01]: The total objects number is 1367.
gs_dump[port='37300'][postgres][2018-06-27 10:37:22]: [100.00%] 1367 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-27 10:37:22]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-27 10:37:22]: total time: 37017 ms</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p864110599344">Example 6: Use <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163213">gs_dump</strong> to export only the information about the views that depend on the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163236">testtable</strong> table. Create another <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b127672043406">testtable</strong> table, and then restore the views that depend on it.</p>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p78093530459">Back up only the views that depend on the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b287090365163324">testtable</strong> table.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1035007184718">gs_dump -s -p 37300 postgres -t PUBLIC.testtable --include-depend-objs --exclude-self -f backup/MPPDB_backup.sql -F p
gs_dump[port='37300'][postgres][2018-06-15 14:12:54]: The total objects number is 331.
gs_dump[port='37300'][postgres][2018-06-15 14:12:54]: [100.00%] 331 objects have been dumped.
gs_dump[port='37300'][postgres][2018-06-15 14:12:54]: dump database postgres successfully
gs_dump[port='37300'][postgres][2018-06-15 14:12:54]: total time: 327 ms</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p16152354114518">Change the name of the <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b2192161875617">testtable</strong> table.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen1710818131471">gsql -p 37300 postgres -r -c "ALTER TABLE PUBLIC.testtable RENAME TO testtable_bak;"</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p123075210493">Create a <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163349">testtable</strong> table.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen857312590503">CREATE TABLE PUBLIC.testtable(a int, b int, c int);</pre>
<p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_p743310216468">Restore the views for the new <strong id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_b842352706163356">testtable</strong> table.</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_screen9643559173415">gsql -p 37300 postgres -r -f backup/MPPDB_backup.sql</pre>
<div class="section" id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_s234c8abfe84d40779a52d522e94bc670"><h4 class="sectiontitle">Helpful Links</h4><p id="EN-US_TOPIC_0000001188362608__en-us_topic_0000001188680980_en-us_topic_0000001099130242_a385090fd24bc4124ad54f82ad0c8926e"><a href="dws_07_0102.html#EN-US_TOPIC_0000001233922249">gs_dumpall</a> and <a href="dws_07_0103.html#EN-US_TOPIC_0000001188521068">gs_restore</a></p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_07_0100.html">Server Tool</a></div>
</div>
</div>