diff --git a/docs/en_US/images/preferences_browser_display.png b/docs/en_US/images/preferences_browser_display.png
index f219832e07993a903bad9cfbd4c4743e33950ca3..39887fbd83039fb654c98a3117431dde455e9959 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_browser_keyboard_shortcuts.png b/docs/en_US/images/preferences_browser_keyboard_shortcuts.png
old mode 100755
new mode 100644
index a4088a80992d57125d58675f750b0464a751d283..28758b1778e14e6b0dd7427d09e857ef727da1a9
GIT binary patch
diff --git a/docs/en_US/images/preferences_browser_nodes.png b/docs/en_US/images/preferences_browser_nodes.png
old mode 100755
new mode 100644
index c45ea9d394b72d95b14e923408f6305ab15ece1f..b181adfe3bb15800a65208949032412478c67689
GIT binary patch
diff --git a/docs/en_US/images/preferences_browser_properties.png b/docs/en_US/images/preferences_browser_properties.png
old mode 100755
new mode 100644
index 0b9c1c4b0ebcbaeeb9702e89ab8484d2fe7a374a..e298cc6d7b2c72e739250b5dbe1cb21796b14029
GIT binary patch
diff --git a/docs/en_US/images/preferences_dashboard_display.png b/docs/en_US/images/preferences_dashboard_display.png
old mode 100755
new mode 100644
index 70fc53b9bddd97164164527f8403ac122d24ef74..251da4d7ef64188d8329b2567f89cf0bb12b622d
GIT binary patch
diff --git a/docs/en_US/images/preferences_dashboard_graphs.png b/docs/en_US/images/preferences_dashboard_graphs.png
old mode 100755
new mode 100644
index b0e09dd0d68b986b2ced048cace2a976a0107a83..ca89a0333d510866119263412576362a56f0fd04
GIT binary patch
diff --git a/docs/en_US/images/preferences_debugger_display.png b/docs/en_US/images/preferences_debugger_display.png
old mode 100755
new mode 100644
index cc760847068cd6567639381a8c4c4570f9bd74a6..30962d97014bdd9b7379c195eb4fa29765f6894f
GIT binary patch
diff --git a/docs/en_US/images/preferences_debugger_keyboard_shortcuts.png b/docs/en_US/images/preferences_debugger_keyboard_shortcuts.png
old mode 100755
new mode 100644
index bc87e681cef066d80d06954d56df1780d4511d08..2c217ab52565382fbed269f5be94f2a38bba2cca
GIT binary patch
diff --git a/docs/en_US/images/preferences_misc_themes.png b/docs/en_US/images/preferences_misc_themes.png
index 460998d45e48278e582a77034d13583e9f83ff08..a606b66847d59e2cbd72e9509e8531b50179e892 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_misc_user_language.png b/docs/en_US/images/preferences_misc_user_language.png
index 3382a59d7de137b8f292a26db27786bf6eb415e4..7529694b23edfc049f8dfc648ae3b92119a2a718 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_paths_binary.png b/docs/en_US/images/preferences_paths_binary.png
old mode 100755
new mode 100644
index 91a508d4034cb609231771bd3f5a2d0f4da9af21..0e130abbff4aab437853550212af667881cd0054
GIT binary patch
diff --git a/docs/en_US/images/preferences_paths_help.png b/docs/en_US/images/preferences_paths_help.png
old mode 100755
new mode 100644
index 16a71c330b8ae87a29e566202a46f07af350ad85..6cffc0f38a52e6f4e646d2170851e49e2770201a
GIT binary patch
diff --git a/docs/en_US/images/preferences_schema_diff.png b/docs/en_US/images/preferences_schema_diff.png
index 89a17eda413b2a35c4a95fc7f4901f9428466db6..e9381da7350877fa07bdfa88d0df5195abad8616 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_auto_completion.png b/docs/en_US/images/preferences_sql_auto_completion.png
index 484c9096b6d8d75e82e9e538b8d271fd84396c0a..16a82c1f3573e45c108caee33dab39f43f001498 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_csv_output.png b/docs/en_US/images/preferences_sql_csv_output.png
index 78247c14c39545cb8a3def9d93a63e93b39d191b..9c7c3796962f29289ac1896d830cc92ad628f316 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_display.png b/docs/en_US/images/preferences_sql_display.png
index 0d6d497697c4518b841842e9dd80e3ee0fa8d088..b9ecbc4d495e3f6a077042723ad9ee7e5a4d043e 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_editor.png b/docs/en_US/images/preferences_sql_editor.png
index b7f43b5f869851995a88177b529bb68423cb9bf2..52194a66c4affe8cb95ce26fef429015ce362706 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_explain.png b/docs/en_US/images/preferences_sql_explain.png
index 5ee134cc9d29c168470bb026e53e2776a40b20a9..f38b1ed6148b75993b480ea94213888a3bafd4b0 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_keyboard_shortcuts.png b/docs/en_US/images/preferences_sql_keyboard_shortcuts.png
index c8a2c0beffe5ed4ffc423a4f9dac407b69b8d2e0..25e1270d46ea4d09a7fa07c14656f3a191038d37 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_options.png b/docs/en_US/images/preferences_sql_options.png
index c1fce1ccaef9e59dd0871afe979fb8e0543bd95b..83b99443d4760f910269c4246bff855a850fac17 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_sql_results_grid.png b/docs/en_US/images/preferences_sql_results_grid.png
index 35a37b31aa061acd890cc1f87351b43e02318157..402c2e58dec660c05bc2abe2464f266acb88e736 100644
GIT binary patch
diff --git a/docs/en_US/images/preferences_storage_options.png b/docs/en_US/images/preferences_storage_options.png
old mode 100755
new mode 100644
index 7c5caf493e83594911ef7b28d470667f6649e661..f3c44631e66c686acc9500ae9f288b710a92a86b
GIT binary patch
diff --git a/docs/en_US/preferences.rst b/docs/en_US/preferences.rst
index db63d01..237b510 100644
--- a/docs/en_US/preferences.rst
+++ b/docs/en_US/preferences.rst
@@ -247,14 +247,14 @@ Use the fields on the *Auto Completion* panel to set the auto completion options
     :alt: Preferences dialog sqleditor csv output option
     :align: center
 
-Use the fields on the *CSV Output* panel to control the CSV output.
+Use the fields on the *CSV/TXT Output* panel to control the CSV/TXT output.
 
 * Use the *CSV field separator* drop-down listbox to specify the separator
-  character that will be used in CSV output.
+  character that will be used in CSV/TXT output.
 * Use the *CSV quote character* drop-down listbox to specify the quote character
-  that will be used in CSV output.
+  that will be used in CSV/TXT output.
 * Use the *CSV quoting* drop-down listbox to select the fields that will be
-  quoted in the CSV output; select *Strings*, *All*, or *None*.
+  quoted in the CSV/TXT output; select *Strings*, *All*, or *None*.
 * Use the *Replace null values with* option to replace null values with
   specified string in the output file. Default is set to 'NULL'.
 
diff --git a/docs/en_US/query_tool.rst b/docs/en_US/query_tool.rst
index bbb9313..7aef684 100644
--- a/docs/en_US/query_tool.rst
+++ b/docs/en_US/query_tool.rst
@@ -122,7 +122,7 @@ You can:
 * Select and copy from the displayed result set.
 * Use the *Execute/Refresh* options to retrieve query execution information and
   set query execution options.
-* Use the *Download as CSV* icon to download the content of the *Data Output*
+* Use the *Download as CSV/TXT* icon to download the content of the *Data Output*
   tab as a comma-delimited file.
 * Edit the data in the result set of a SELECT query if it is updatable.
 
diff --git a/docs/en_US/query_tool_toolbar.rst b/docs/en_US/query_tool_toolbar.rst
index 4d9c151..75f9927 100644
--- a/docs/en_US/query_tool_toolbar.rst
+++ b/docs/en_US/query_tool_toolbar.rst
@@ -177,7 +177,8 @@ Query Execution
    |                      |                                                                                                   |                |
    |                      |  * Select *Clear History* to erase the content of the *History* tab.                              |                |
    +----------------------+---------------------------------------------------------------------------------------------------+----------------+
-   | *Download as CSV*    | Click the *Download as CSV* icon to download the result set of the current query to a             | F8             |
-   |                      | comma-separated list. You can specify the CSV settings through                                    |                |
-   |                      | *Preferences -> SQL Editor -> CSV output* dialogue.                                               |                |
+   | *Download as CSV/TXT*| Click the *Download as CSV/TXT* icon to download the result set of the current query as a *.csv*  | F8             |
+   |                      | or as a *.txt* file. if *CSV field seperator* set to comma(,) else as a *.txt* file.              |                |
+   |                      | You can specify the CSV/TXT settings through *Preferences -> SQL Editor -> CSV/TXT output*        |                |
+   |                      | dialogue.                                                                                         |                |
    +----------------------+---------------------------------------------------------------------------------------------------+----------------+
diff --git a/web/pgadmin/static/js/sqleditor/query_tool_actions.js b/web/pgadmin/static/js/sqleditor/query_tool_actions.js
index 358db8d..a29e0f5 100644
--- a/web/pgadmin/static/js/sqleditor/query_tool_actions.js
+++ b/web/pgadmin/static/js/sqleditor/query_tool_actions.js
@@ -83,11 +83,11 @@ let queryToolActions = {
     }
 
     if (!sqlQuery) return;
-
-    let filename = 'data-' + new Date().getTime() + '.csv';
+    let extension = sqlEditorController.preferences.csv_field_separator === ',' ? '.csv': '.txt';
+    let filename = 'data-' + new Date().getTime() + extension;
 
     if (!sqlEditorController.is_query_tool) {
-      filename = sqlEditorController.table_name + '.csv';
+      filename = sqlEditorController.table_name + extension;
     }
 
     sqlEditorController.trigger_csv_download(sqlQuery, filename);
diff --git a/web/pgadmin/static/js/sqleditor/query_tool_preferences.js b/web/pgadmin/static/js/sqleditor/query_tool_preferences.js
index 5539847..5a3d155 100644
--- a/web/pgadmin/static/js/sqleditor/query_tool_preferences.js
+++ b/web/pgadmin/static/js/sqleditor/query_tool_preferences.js
@@ -114,9 +114,9 @@ function updateUIPreferences(sqlEditor) {
 
   $el.find('#btn-download')
     .attr('title',
-      shortcut_title(gettext('Download as CSV'),preferences.download_csv))
+      shortcut_title(gettext('Download as CSV/TXT'),preferences.download_csv))
     .attr('aria-label',
-      shortcut_title(gettext('Download as CSV'),preferences.download_csv));
+      shortcut_title(gettext('Download as CSV/TXT'),preferences.download_csv));
 
   $el.find('#btn-save-data')
     .attr('title',
diff --git a/web/pgadmin/tools/sqleditor/__init__.py b/web/pgadmin/tools/sqleditor/__init__.py
index 2d1fd1a..0c46b00 100644
--- a/web/pgadmin/tools/sqleditor/__init__.py
+++ b/web/pgadmin/tools/sqleditor/__init__.py
@@ -1328,14 +1328,18 @@ def start_query_download_tool(trans_id):
                         field_separator=blueprint.csv_field_separator.get(),
                         replace_nulls_with=blueprint.replace_nulls_with.get()
                     ),
-                    mimetype='text/csv'
+                    mimetype='text/csv' if
+                    blueprint.csv_field_separator.get() == ','
+                    else 'text/plain'
                 )
 
                 if 'filename' in data and data['filename'] != "":
                     filename = data['filename']
                 else:
                     import time
-                    filename = str(int(time.time())) + ".csv"
+                    filename = '{0}.{1}'. \
+                        format(int(time.time()), 'csv' if blueprint.
+                               csv_field_separator.get() == ',' else 'txt')
 
                 # We will try to encode report file name with latin-1
                 # If it fails then we will fallback to default ascii file name
diff --git a/web/pgadmin/tools/sqleditor/tests/test_download_csv_query_tool.py b/web/pgadmin/tools/sqleditor/tests/test_download_csv_query_tool.py
index f4a72f0..98d0fae 100644
--- a/web/pgadmin/tools/sqleditor/tests/test_download_csv_query_tool.py
+++ b/web/pgadmin/tools/sqleditor/tests/test_download_csv_query_tool.py
@@ -7,6 +7,7 @@
 # This software is released under the PostgreSQL Licence
 #
 ##########################################################################
+from unittest.mock import patch
 
 from pgadmin.utils.route import BaseTestGenerator
 from pgadmin.browser.server_groups.servers.databases.tests import utils as \
@@ -32,7 +33,9 @@ class TestDownloadCSV(BaseTestGenerator):
                 output_columns='"A","B","C"',
                 output_values='1,2,3',
                 is_valid_tx=True,
-                is_valid=True
+                is_valid=True,
+                download_as_txt=False,
+                filename='test.csv'
             )
         ),
         (
@@ -44,7 +47,9 @@ class TestDownloadCSV(BaseTestGenerator):
                 output_columns=None,
                 output_values=None,
                 is_valid_tx=False,
-                is_valid=False
+                is_valid=False,
+                download_as_txt=False,
+                filename='test.csv'
             )
         ),
         (
@@ -56,7 +61,37 @@ class TestDownloadCSV(BaseTestGenerator):
                 output_columns=None,
                 output_values=None,
                 is_valid_tx=True,
-                is_valid=False
+                is_valid=False,
+                download_as_txt=False,
+                filename='test.csv'
+            )
+        ),
+        (
+            'Download as txt without filename parameter',
+            dict(
+                sql='SELECT 1 as "A",2 as "B",3 as "C"',
+                init_url='/datagrid/initialize/query_tool/{0}/{1}/{2}/{3}',
+                donwload_url="/sqleditor/query_tool/download/{0}",
+                output_columns='"A";"B";"C"',
+                output_values='1;2;3',
+                is_valid_tx=True,
+                is_valid=True,
+                download_as_txt=True,
+                filename=None
+            )
+        ),
+        (
+            'Download as csv without filename parameter',
+            dict(
+                sql='SELECT 1 as "A",2 as "B",3 as "C"',
+                init_url='/datagrid/initialize/query_tool/{0}/{1}/{2}/{3}',
+                donwload_url="/sqleditor/query_tool/download/{0}",
+                output_columns='"A","B","C"',
+                output_values='1,2,3',
+                is_valid_tx=True,
+                is_valid=True,
+                download_as_txt=False,
+                filename=None
             )
         ),
     ]
@@ -95,30 +130,62 @@ class TestDownloadCSV(BaseTestGenerator):
         url = self.donwload_url.format(self.trans_id)
         # Disable the console logging from Flask logger
         self.app.logger.disabled = True
-        response = self.tester.post(
-            url,
-            data={"query": self.sql, "filename": 'test.csv'}
-        )
-        # Enable the console logging from Flask logger
-        self.app.logger.disabled = False
-        if self.is_valid:
-            # when valid query
-            self.assertEquals(response.status_code, 200)
-            csv_data = response.data.decode()
-            self.assertTrue(self.output_columns in csv_data)
-            self.assertTrue(self.output_values in csv_data)
-        elif not self.is_valid and self.is_valid_tx:
-            # When user enters wrong query
-            self.assertEquals(response.status_code, 200)
-            response_data = json.loads(response.data.decode('utf-8'))
-            self.assertFalse(response_data['data']['status'])
-            self.assertTrue(
-                'relation "this_table_does_not_exist" does not exist' in
-                response_data['data']['result']
-            )
+        if self.filename is None:
+            if self.download_as_txt:
+                with patch('pgadmin.tools.sqleditor.blueprint.'
+                           'csv_field_separator.get', return_value=';'), patch(
+                        'time.time', return_value=1587031962.3808076):
+                    response = self.tester.post(url, data={"query": self.sql})
+                    headers = dict(response.headers)
+                    # when valid query
+                    self.assertEquals(response.status_code, 200)
+                    csv_data = response.data.decode()
+                    self.assertTrue(self.output_columns in csv_data)
+                    self.assertTrue(self.output_values in csv_data)
+                    self.assertIn('text/plain', headers['Content-Type'])
+                    self.assertIn('1587031962.txt',
+                                  headers['Content-Disposition'])
+            else:
+                with patch('time.time', return_value=1587031962.3808076):
+                    response = self.tester.post(url, data={"query": self.sql})
+                    headers = dict(response.headers)
+                    # when valid query
+                    self.assertEquals(response.status_code, 200)
+                    csv_data = response.data.decode()
+                    self.assertTrue(self.output_columns in csv_data)
+                    self.assertTrue(self.output_values in csv_data)
+                    self.assertIn('text/csv', headers['Content-Type'])
+                    self.assertIn('1587031962.csv',
+                                  headers['Content-Disposition'])
+
         else:
-            # when TX id is invalid
-            self.assertEquals(response.status_code, 500)
+            response = self.tester.post(
+                url,
+                data={"query": self.sql, "filename": self.filename}
+            )
+            headers = dict(response.headers)
+            # Enable the console logging from Flask logger
+            self.app.logger.disabled = False
+            if self.is_valid:
+                # when valid query
+                self.assertEquals(response.status_code, 200)
+                csv_data = response.data.decode()
+                self.assertTrue(self.output_columns in csv_data)
+                self.assertTrue(self.output_values in csv_data)
+                self.assertIn('text/csv', headers['Content-Type'])
+                self.assertIn(self.filename, headers['Content-Disposition'])
+            elif not self.is_valid and self.is_valid_tx:
+                # When user enters wrong query
+                self.assertEquals(response.status_code, 200)
+                response_data = json.loads(response.data.decode('utf-8'))
+                self.assertFalse(response_data['data']['status'])
+                self.assertTrue(
+                    'relation "this_table_does_not_exist" does not exist' in
+                    response_data['data']['result']
+                )
+            else:
+                # when TX id is invalid
+                self.assertEquals(response.status_code, 500)
 
         database_utils.disconnect_database(self, self._sid, self._did)
 
diff --git a/web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py b/web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py
index a4d74e8..d96a600 100644
--- a/web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py
+++ b/web/pgadmin/tools/sqleditor/utils/query_tool_preferences.py
@@ -211,7 +211,7 @@ def RegisterQueryToolPreferences(self):
     self.csv_quoting = self.preference.register(
         'CSV_output', 'csv_quoting',
         gettext("CSV quoting"), 'options', 'strings',
-        category_label=gettext('CSV Output'),
+        category_label=gettext('CSV/TXT Output'),
         options=[{'label': gettext('None'), 'value': 'none'},
                  {'label': gettext('All'), 'value': 'all'},
                  {'label': gettext('Strings'), 'value': 'strings'}],
@@ -224,7 +224,7 @@ def RegisterQueryToolPreferences(self):
     self.csv_quote_char = self.preference.register(
         'CSV_output', 'csv_quote_char',
         gettext("CSV quote character"), 'options', '"',
-        category_label=gettext('CSV Output'),
+        category_label=gettext('CSV/TXT Output'),
         options=[{'label': '"', 'value': '"'},
                  {'label': '\'', 'value': '\''}],
         select2={
@@ -236,7 +236,7 @@ def RegisterQueryToolPreferences(self):
     self.csv_field_separator = self.preference.register(
         'CSV_output', 'csv_field_separator',
         gettext("CSV field separator"), 'options', ',',
-        category_label=gettext('CSV output'),
+        category_label=gettext('CSV/TXT output'),
         options=[{'label': ';', 'value': ';'},
                  {'label': ',', 'value': ','},
                  {'label': '|', 'value': '|'},
@@ -250,7 +250,7 @@ def RegisterQueryToolPreferences(self):
     self.replace_nulls_with = self.preference.register(
         'CSV_output', 'csv_replace_nulls_with',
         gettext("Replace null values with"), 'text', 'NULL',
-        category_label=gettext('CSV output'),
+        category_label=gettext('CSV/TXT output'),
         help_str=gettext('Specifies the string that represents a null value '
                          'while downloading query results as CSV. You can '
                          'specify any arbitrary string to represent a '
diff --git a/web/regression/javascript/sqleditor/query_tool_actions_spec.js b/web/regression/javascript/sqleditor/query_tool_actions_spec.js
index 9152b8e..3b56e15 100644
--- a/web/regression/javascript/sqleditor/query_tool_actions_spec.js
+++ b/web/regression/javascript/sqleditor/query_tool_actions_spec.js
@@ -298,13 +298,22 @@ describe('queryToolActions', () => {
           }));
         });
 
-        it('calls trigger_csv_download with the query and the filename', () => {
+        it('calls trigger_csv_download with the query and the filename with .csv extension', () => {
           let filename = 'data-' + time + '.csv';
 
           queryToolActions.download(sqlEditorController);
 
           expect(sqlEditorController.trigger_csv_download).toHaveBeenCalledWith(selectedQueryString, filename);
         });
+
+        it('calls trigger_csv_download with the query and the filename with .txt extension', () => {
+          sqlEditorController.preferences.csv_field_separator = ';';
+          let filename = 'data-' + time + '.txt';
+
+          queryToolActions.download(sqlEditorController);
+
+          expect(sqlEditorController.trigger_csv_download).toHaveBeenCalledWith(selectedQueryString, filename);
+        });
       });
 
       describe('when there is no selection', () => {
@@ -622,6 +631,9 @@ describe('queryToolActions', () => {
       table_name: 'iAmATable',
       is_query_tool: true,
       check_data_changes_to_execute_query: jasmine.createSpy('check_data_changes_to_execute_query'),
+      preferences: {
+        csv_field_separator: ',',
+      },
     };
   }
 });
