Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: resolved using host when it's postgres with gateway

Akhil Mohand7fae950bfb3
diff --git a/backend/src/ee/services/dynamic-secret/providers/sql-database.ts b/backend/src/ee/services/dynamic-secret/providers/sql-database.ts
index 57ce710b14..e68e41c6be 100644
--- a/backend/src/ee/services/dynamic-secret/providers/sql-database.ts
+++ b/backend/src/ee/services/dynamic-secret/providers/sql-database.ts
@@ -161,7 +161,10 @@ export const SqlDatabaseProvider = ({ gatewayService }: TSqlDatabaseProviderDTO)
connection: {
database: providerInputs.database,
port: providerInputs.port,
- host: providerInputs.client === SqlProviders.Postgres ? providerInputs.hostIp : providerInputs.host,
+ host:
+ providerInputs.client === SqlProviders.Postgres && !providerInputs.gatewayId
+ ? providerInputs.hostIp
+ : providerInputs.host,
user: providerInputs.username,
password: providerInputs.password,
ssl,