Thread: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binary paths"entered in Preferences
[pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binary paths"entered in Preferences
From
Surinder Kumar
Date:
Hi
Issue:
The user seems to enter sometimes paths with quotes and sometimes add spaces which lead to failure of Backup, Restore or Maintenance utility.
Changes:
- Added a note in help string `Note: Don't add quote(s) or space(s) before or after the path.`
- Remove whitespace before/after the value before it gets saved.
Please find attached patch and review.
Thanks,
Surinder
Attachment
Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binarypaths" entered in Preferences
From
Dave Page
Date:
On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
HiIssue:The user seems to enter sometimes paths with quotes and sometimes add spaces which lead to failure of Backup, Restore or Maintenance utility.Changes:- Added a note in help string `Note: Don't add quote(s) or space(s) before or after the path.`- Remove whitespace before/after the value before it gets saved.Please find attached patch and review.
I wonder if the more appropriate fix here would be to add a new setting type (perhaps two, one for directory and one for file), which is rendered with a browse button in the prefs panel, and includes real validation.
Stripping spaces and warning about quotes seems like it's just kicking the basic problem down the road a few feet.
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binarypaths" entered in Preferences
From
Surinder Kumar
Date:
On Tue, Aug 22, 2017 at 6:07 PM, Dave Page <dpage@pgadmin.org> wrote:
On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote: HiIssue:The user seems to enter sometimes paths with quotes and sometimes add spaces which lead to failure of Backup, Restore or Maintenance utility.Changes:- Added a note in help string `Note: Don't add quote(s) or space(s) before or after the path.`- Remove whitespace before/after the value before it gets saved.Please find attached patch and review.I wonder if the more appropriate fix here would be to add a new setting type (perhaps two, one for directory and one for file), which is rendered with a browse button in the prefs panel, and includes real validation.
Yes, the suggested way is a better way.
I will check what changes we have to made in preferences code to add support for new setting type and validations.
Stripping spaces and warning about quotes seems like it's just kicking the basic problem down the road a few feet.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binarypaths" entered in Preferences
From
Murtuza Zabuawala
Date:
https://redmine.postgresql.org/issues/2008
On Tue, Aug 22, 2017 at 7:14 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
On Tue, Aug 22, 2017 at 6:07 PM, Dave Page <dpage@pgadmin.org> wrote:On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote: HiIssue:The user seems to enter sometimes paths with quotes and sometimes add spaces which lead to failure of Backup, Restore or Maintenance utility.Changes:- Added a note in help string `Note: Don't add quote(s) or space(s) before or after the path.`- Remove whitespace before/after the value before it gets saved.Please find attached patch and review.I wonder if the more appropriate fix here would be to add a new setting type (perhaps two, one for directory and one for file), which is rendered with a browse button in the prefs panel, and includes real validation.Yes, the suggested way is a better way.I will check what changes we have to made in preferences code to add support for new setting type and validations.Stripping spaces and warning about quotes seems like it's just kicking the basic problem down the road a few feet.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Re: [pgAdmin4][Patch]: RM_ 2658 - Improve help message for "binarypaths" entered in Preferences
From
Surinder Kumar
Date:
Hi Dave,
On Tue, Aug 22, 2017 at 7:22 PM, Murtuza Zabuawala <murtuza.zabuawala@ enterprisedb.com> wrote:
https://redmine.postgresql.org/issues/2008 On Tue, Aug 22, 2017 at 7:14 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote: On Tue, Aug 22, 2017 at 6:07 PM, Dave Page <dpage@pgadmin.org> wrote:On Tue, Aug 22, 2017 at 1:30 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote: HiIssue:The user seems to enter sometimes paths with quotes and sometimes add spaces which lead to failure of Backup, Restore or Maintenance utility.Changes:- Added a note in help string `Note: Don't add quote(s) or space(s) before or after the path.`- Remove whitespace before/after the value before it gets saved.Please find attached patch and review.I wonder if the more appropriate fix here would be to add a new setting type (perhaps two, one for directory and one for file), which is rendered with a browse button in the prefs panel, and includes real validation.
I thought of using Folder selection dialog (or Backform.FileControl) for browsing the directory path.
But
FileControl won't work because
We do not allow the user to access file system outside his root dir (~/.pgadmin/surinder/) in server mode so this will not allow user to select bin dir path from folder select dialog as it is outside his root dir.
Yes, the suggested way is a better way.I will check what changes we have to made in preferences code to add support for new setting type and validations.Stripping spaces and warning about quotes seems like it's just kicking the basic problem down the road a few feet.--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company