|
| 1 | +.. _export_data_using_query: |
| 2 | + |
| 3 | +*************************************** |
| 4 | +`Export Data Using Query Dialog`:index: |
| 5 | +*************************************** |
| 6 | + |
| 7 | +Use the *Export Data Using Query* dialog to copy data to a file. |
| 8 | + |
| 9 | +The *Export Data Using Query* dialog organizes the export of data through the |
| 10 | +*General*, *Options* and *Query* tabs. |
| 11 | + |
| 12 | +.. image:: images/export_query_general.png |
| 13 | + :alt: Export data using query dialog general tab |
| 14 | + :align: center |
| 15 | + |
| 16 | +Use the fields in the *General* tab to specify export preferences: |
| 17 | + |
| 18 | +* Enter the name of the target file in the *Filename* field. |
| 19 | + Optionally, select the *Browse* icon (ellipsis) to the right to navigate |
| 20 | + into a directory and select a file. |
| 21 | + |
| 22 | +* Use the drop-down listbox in the *Format* field to specify the file type. |
| 23 | + Select: |
| 24 | + |
| 25 | + * *binary* for a .bin file. |
| 26 | + * *csv* for a .csv file. |
| 27 | + * *text* for a .txt file. |
| 28 | + |
| 29 | +* Use the drop-down listbox in the *Encoding* field to specify the type of |
| 30 | + character encoding. |
| 31 | + |
| 32 | +.. image:: images/export_query_options.png |
| 33 | + :alt: Export data using query dialog options tab |
| 34 | + :align: center |
| 35 | + |
| 36 | +* Use the fields in the *Options* tab to specify additional information: |
| 37 | + |
| 38 | + * Move the *Header* switch to the *Yes* position to include the table header |
| 39 | + with the data rows. If you include the table header, the first row of the |
| 40 | + file will contain the column names. |
| 41 | + * If you are exporting data, specify the delimiter that will separate the |
| 42 | + columns within the target file in the *Delimiter* field. The separating |
| 43 | + character can be a colon, semicolon, a vertical bar, or a tab. |
| 44 | + * Specify a quoting character used in the *Quote* field. Quoting can be |
| 45 | + applied to string columns only (i.e. numeric columns will not be quoted) |
| 46 | + or all columns regardless of data type. The character used for quoting can |
| 47 | + be a single quote or a double quote. |
| 48 | + * Specify a character that should appear before a data character that matches |
| 49 | + the *QUOTE* value in the *Escape* field. |
| 50 | + * Use the *NULL String* field to specify a string that will represent a null |
| 51 | + value within the source or target file. |
| 52 | + |
| 53 | +Click the *Query* tab to continue. |
| 54 | + |
| 55 | +.. image:: images/export_query.png |
| 56 | + :alt: Export data using query dialog query tab |
| 57 | + :align: center |
| 58 | + |
| 59 | +Use the fields in the *Query* tab to write the query that will be exported: |
| 60 | + |
| 61 | +* Use the *Export Data Query* field to specifies A SELECT, VALUES, INSERT, UPDATE, |
| 62 | + DELETE, or MERGE command whose results are to be copied . |
| 63 | + |
| 64 | +* Use *Force Quote columns* field to forces quoting to be used for all non-NULL |
| 65 | + values in each specified column. NULL output is never quoted. This is a creatable |
| 66 | + select control. If you would like to quote all columns then provide only '*' in |
| 67 | + the field. |
| 68 | + |
| 69 | +After completing the *Export Data Using Query* dialog, click the *OK* button to |
| 70 | +perform the export. pgAdmin will notify you when the background |
| 71 | +process completes: |
| 72 | + |
| 73 | +.. image:: images/export_query_complete.png |
| 74 | + :alt: Export data using query completion notification |
| 75 | + :align: center |
| 76 | + |
| 77 | + |
| 78 | +Use the *View Processes* button on the notification to open the *Process |
| 79 | +Watcher* and review detailed information about the execution of the command |
| 80 | +that performed the export: |
| 81 | + |
| 82 | +Use the **End Process** button to end the Export process. |
| 83 | + |
| 84 | +.. image:: images/export_query_pw.png |
| 85 | + :alt: Export data using query process watcher |
| 86 | + :align: center |
| 87 | + |
| 88 | +.. note:: If you are running *pgAdmin* in *Server Mode* you can click on the |sm_icon| icon in the process watcher window to open the file location in the Storage Manager. You can use the :ref:`Storage Manager <storage_manager>` to download the exported file on the client machine . |
| 89 | + |
| 90 | + |
| 91 | +.. |sm_icon| image:: images/sm_icon.png |
0 commit comments