Use one connection only / pgAdmin and AWS RDS with IAM authentication - Mailing list pgadmin-support

From Harry Lond
Subject Use one connection only / pgAdmin and AWS RDS with IAM authentication
Date
Msg-id EkrHPcVoA7rcJuoTEhhA4iFXd8o0i98qG9nuExnDVVWJhbK9v8t1x40umREqxGspKfp27Q-LR-8O11Hg_9bLvma0xjOojZXEoPAXqy7-1pY=@proton.me
Whole thread Raw
Responses Re: Use one connection only / pgAdmin and AWS RDS with IAM authentication  (Dave Page <dpage@pgadmin.org>)
List pgadmin-support
Hi,

I start with the actual question: is there a way to configure pgAdmin not to open a new connection for each query? So to re-use the already opened connection that is used for the dashboard and use this one connection only? Maybe with a config parameter?

Background: we are using pgAdmin in server mode in order to connect to AWS RDS clusters with IAM authentication enabled.

In this scenario, the auth token created by 'aws rds generate-db-auth-token' is valid for 15 minutes only (no possibility to extend this).

Setup works fine for the first 15 minutes. Connection can be established, dashboard works and queries can be executed.

But while the dashboard and all query tool windows that have been opened prior to the token expiration remain useable, all new user interaction fails once the token expires.
 
Opening a new query tool window asks for the password. Querying the first 100 rows of a table (when using 'view/edit data -> first 100 rows') fails without asking for a new password (shows PAM authentication failed for user ...). No way to recover from that, then reloading the whole pgAdmin page and re-connect to the database.

We figured out that this is because of the underlying pgAdmin connection handling. All new interaction tries to open new connections, which is not possible because of the expired token.

One might say this works like designed because the token/password is no longer valid. However, from an end user perspective pgAdmin is not really useable with AWS clusters that have IAM authentication enabled right now.

That's why we had the idea to re-use the original connection that is used by the dashboard. Or is there maybe another solution for this?

Best,
Harry

pgadmin-support by date:

Previous
From: Marcello Z Fabila
Date:
Subject: RE: pgAdmin4 Installation Issues
Next
From: Dave Page
Date:
Subject: Re: Use one connection only / pgAdmin and AWS RDS with IAM authentication