From be4db5ce048f30176325c1f85f5b10bd70117eae Mon Sep 17 00:00:00 2001 From: Nikhil Mohite Date: Tue, 13 Jun 2023 12:04:26 +0530 Subject: [PATCH] Fixed an issue where PSQL tool not working if the database name have single and double quotes #6431 --- web/pgadmin/tools/psql/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/pgadmin/tools/psql/__init__.py b/web/pgadmin/tools/psql/__init__.py index b07b240ec..6f5566a8b 100644 --- a/web/pgadmin/tools/psql/__init__.py +++ b/web/pgadmin/tools/psql/__init__.py @@ -296,7 +296,7 @@ def start_process(data): try: db = '' if data['db']: - db = underscore_unescape(data['db']).replace('\\', "\\\\") + db = underscore_unescape(data['db']) data['db'] = db @@ -378,8 +378,6 @@ def get_connection_str(psql_utility, db, manager): :return: connection attribute list for PSQL connection. """ manager.export_password_env('PGPASSWORD') - db = db.replace('"', '\\"') - db = db.replace("'", "\\'") database = db if db != '' else 'postgres' user = underscore_unescape(manager.user) if manager.user else None conn_attr = manager.create_connection_string(database, user)