Description
Creating a backup fails when the PostgreSQL database name contains spaces or special characters.
For example, a backup of the following database fails:
The generated pg_dump command works when executed directly in a system terminal, but it does not work when executed by pgManage.
Steps to reproduce
- Create a PostgreSQL database with a name containing spaces or special characters, for example:
CREATE DATABASE "pgManage QA! DB";
- Add or open a connection to this database in pgManage.
- Open the Backup tab.
- Select the custom backup format.
- Select a valid writable output location.
- Start the backup.
Observed result
The backup fails with an error similar to:
[Errno 30] Read-only file system: 'DB'
The generated command is similar to:
/usr/lib/postgresql/16/bin/pg_dump \
--file "../storage/1/asd-backup" \
--host "127.0.0.1" \
--port "5432" \
--username "postgres" \
--no-password \
--verbose \
--role "pgmanage_test_admin" \
--format=c \
--blobs \
--dbname "pgManage QA! DB"
Running the same command directly in a system terminal completes successfully.
Expected result
pgManage should pass the complete database name to pg_dump as a single argument.
Databases with spaces, punctuation, mixed case, or other characters requiring quoting should be backed up successfully.
Description
Creating a backup fails when the PostgreSQL database name contains spaces or special characters.
For example, a backup of the following database fails:
The generated
pg_dumpcommand works when executed directly in a system terminal, but it does not work when executed by pgManage.Steps to reproduce
CREATE DATABASE "pgManage QA! DB";Observed result
The backup fails with an error similar to:
The generated command is similar to:
Running the same command directly in a system terminal completes successfully.
Expected result
pgManage should pass the complete database name to
pg_dumpas a single argument.Databases with spaces, punctuation, mixed case, or other characters requiring quoting should be backed up successfully.