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

pull/6440/head
Nikhil Mohite 2023-06-13 12:04:26 +05:30 committed by GitHub
parent c90f831493
commit be4db5ce04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

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)