pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Username is required even though SharedUsername is set

Open ViliusS opened this issue 3 months ago • 1 comments

Describe the bug

Not sure if this is by design but when using SharedUsername in server definition the Username field is still required. If only SharedUsername is provided pgAdmin shows an error and server list is not populated.

To Reproduce

Steps to reproduce the behavior:

  1. Use the following servers.json definition file:
    {
      "Servers": {
        "mysharedserver": {
          "Name": "My Shared Server",
          "Group": "Shared Servers",
          "Host": "postgresql",
          "Port": 5432,
          "MaintenanceDB": "postgres",
          "Shared": true,
          "SharedUsername": "postgres"
        }
      }
    }
    
  2. Set PGADMIN_SERVER_JSON_FILE environment variable to point to the servers.json definition file.
  3. Start pgAdmin and observe the server list. It will be empty.
  4. Now add "Username": "postgres", into the list.
  5. Restart pgAdmin. Server list is now correctly populated.

Expected behavior

If Shared Username is used there should be no need to duplicate it into two parameters.

Error message

'Username' attribute not found for server 'mysharedserver'

Desktop

  • OS: Linux
  • pgAdmin version: 9.8
  • Mode: Server
  • Browser (if running in server mode): Edge
  • Package type: Container

ViliusS avatar Oct 08 '25 21:10 ViliusS

One additional note: not sure if that is related, but Shared Username cannot be edited once the server definition is created.

ViliusS avatar Oct 09 '25 11:10 ViliusS