Use one connection only / pgAdmin and AWS RDS with IAM authentication

From: Harry Lond <hlond(at)proton(dot)me>
To: "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Use one connection only / pgAdmin and AWS RDS with IAM authentication
Date: 2024-03-05 08:43:04
Message-ID: EkrHPcVoA7rcJuoTEhhA4iFXd8o0i98qG9nuExnDVVWJhbK9v8t1x40umREqxGspKfp27Q-LR-8O11Hg_9bLvma0xjOojZXEoPAXqy7-1pY=@proton.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Dave Page 2024-03-05 10:43:42 Re: Use one connection only / pgAdmin and AWS RDS with IAM authentication
Previous Message Marcello Z Fabila 2024-03-04 22:22:33 RE: pgAdmin4 Installation Issues