PostgreSQL Query (SSL)
Description
Section titled “Description”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.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | PostgreSQL connection credentials with SSL certificates |
| query | code | Yes | SQL query to execute (supports {{variable}} variables) |
Credentials
Section titled “Credentials”The credential must contain the fields:
host: PostgreSQL server addressuser: Database userpassword: User passworddatabase: Database nameport: 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, ifverify-fullthe server certificate is validated
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": [ { "id": 1, "nombre": "Ejemplo", "estado": "activo" } ]}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "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
sslmodeisverify-full, the server certificate is validated against the root CA - The connection is closed and temporary files are deleted in the
finallyblock, 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
Related Nodes
Section titled “Related Nodes”- sqlQueryPostgres (PostgreSQL queries without certificates)
- sqlQuery (MySQL queries)
- sqlQueryMSSQL (SQL Server queries)
- sqlQueryOracle (Oracle queries)