Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to setup role" with hyphens in name #6531

Closed
Arawn-Davies opened this issue Jul 5, 2023 · 3 comments
Closed

"Failed to setup role" with hyphens in name #6531

Arawn-Davies opened this issue Jul 5, 2023 · 3 comments
Assignees
Milestone

Comments

@Arawn-Davies
Copy link

Please note that security bugs or issues should be reported to security@pgadmin.org.

Describe the bug

At my organisation, we have roles setup, and one of these roles is "giscorp-pg-ict-admin". In pgAdmin 4 v6.21 I am able to connect using this role, specified in the server properties window, however when I use the same server .json list in pgAdmin 4 v7.3 it gives this error

Failed to setup the role syntax error at or near "-" LINE 1: SET ROLE TO giscorp-pg-ict-admin ^

I've tried to escape the role name by surrounding it in single and double quotes, but single quotes return the error:

Failed to setup the role the cursor is closed

and double quotes return the error:

Failed to setup the role "giscorp-pg-ict-admin"

To Reproduce

Steps to reproduce the behavior:
Setup a role with hyphens in the name, and set role using the specified role just created

Expected behavior

Log in as the specified role, as it works in pgAdmin v6

Error message

Single quotes return the error:

Failed to setup the role the cursor is closed

and double quotes return the error:

Failed to setup the role "giscorp-pg-ict-admin"

Desktop (please complete the following information):

  • OS: Windows 10 Enterprise
  • Version: 22H2 (19045.3086)
  • Mode: Desktop

Additional context
I'm fairly low on the organisational hierarchy so I won't be able to perform any workarounds, although they'll probably just tell us to stick with v6 for the time being.

Thank you!

@akshay-joshi
Copy link
Contributor

Hi @Arawn-Davies

I have tried the same scenario but am unable to reproduce it on v7.4.
Screenshot 2023-07-06 at 9 43 52 AM
Screenshot 2023-07-06 at 9 44 57 AM

Am I missing something?

@randombk
Copy link

randombk commented Jul 8, 2023

Hi,

The issue is with the 'role' field, not the username field.

image

@FaharAbbasRizvi
Copy link
Contributor

This is fixed in the latest snapshot build:
https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2023-07-14/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants