Fixed an issue where PSQL tool not working if the database name have single and double quotes #6431

This commit is contained in:
Nikhil Mohite
2023-06-13 12:04:26 +05:30
committed by GitHub
parent c90f831493
commit be4db5ce04

View File

@@ -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)