-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
- Database type and version: PostgreSQL 14
Steps:
- Connect PostgreSQL database in the client, with a user which has a password containing a single-quote
- Right-click on the connected DB and selecting Dump Data & Structure
The psql
command used "under the bonnet" fails because the password is enclosed by single-quotes.
export PGPASSWORD='PASSWORD'CONTAINING'SINGLE'QUOTES' && pg_dump -h 127.0.0.1 -w -p 5432 -U [USER_NAME] [DB_NAME] > [OUTPUT_FILE]
Perhaps this could be easily fixed by checking whether single-quotes or double-quotes are in the password and using the appropriate enclosing characters or using escape sequences?
For example:
export PGPASSWORD="PASSWORD'CONTAINING'SINGLE'QUOTES" && pg_dump -h 127.0.0.1 -w -p 5432 -U [USER_NAME] [DB_NAME] > [OUTPUT_FILE]
... would work for passwords with single-quotes and more generally, there are also double quotes:
export PGPASSWORD="PASSWORD'CONTAINING'SINGLE'QUOTES\"AND\"DOUBLE\"QUOTES" && pg_dump -h 127.0.0.1 -w -p 5432 -U [USER_NAME] [DB_NAME] > [OUTPUT_FILE]
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working