Skip to content

PostgreSQL Query (SSL)

The PostgreSQL Query (SSL) module allows executing SQL queries on PostgreSQL databases using SSL connections with client certificates. Unlike the standard PostgreSQL Query module, this module requires complete SSL certificates (cert, key and CA) that are written as temporary files during execution and deleted upon completion. It is ideal for connections to PostgreSQL databases that require mutual TLS authentication, such as production environments with strict security.

ParameterTypeRequiredDescription
credentials_idcredentialsYesPostgreSQL connection credentials with SSL certificates
querycodeYesSQL query to execute (supports {{variable}} variables)

The credential must contain the fields:

  • host: PostgreSQL server address
  • user: Database user
  • password: User password
  • database: Database name
  • port: Connection port (default: 5432)
  • sslcert: Client SSL certificate content (PEM)
  • sslkey: Client SSL private key content (PEM)
  • sslrootcert: Root CA certificate content (PEM)
  • sslmode: SSL mode, if verify-full the server certificate is validated
{
"nextModule": "siguiente_modulo",
"data": [
{ "id": 1, "nombre": "Ejemplo", "estado": "activo" }
]
}
{
"credentials_id": "cred_postgres_ssl_01",
"query": "SELECT * FROM transacciones WHERE fecha >= '2024-01-01'"
}
  • Supports dynamic variables {{variable}} in the SQL query
  • Certificates are written as temporary files in the operating system directory and are automatically deleted upon completion
  • If sslmode is verify-full, the server certificate is validated against the root CA
  • The connection is closed and temporary files are deleted in the finally block, even if an error occurs
  • In case of SQL error, the executed query is included in the error message
  • Temporary file names include a timestamp to avoid collisions
  • sqlQueryPostgres (PostgreSQL queries without certificates)
  • sqlQuery (MySQL queries)
  • sqlQueryMSSQL (SQL Server queries)
  • sqlQueryOracle (Oracle queries)