Skip to content

PostgreSQL Connection String

Builds a PostgreSQL database connection URI from individual parameters. It concatenates host, port, database, username, and password, and conditionally appends schema and SSL options as query parameters. Designed as a helper to generate a ready-to-use connection string for downstream database nodes or external tools.

Usage

Use this node when you need a correctly formatted PostgreSQL connection string from separate inputs (e.g., for plugging into other database nodes or services). Typical workflow: provide your server details and credentials, choose SSL mode if needed, and pass the generated URI to nodes that accept a connection string.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase hostname or IP address.localhost
portTrueINTDatabase port number. Must be between 1 and 65535.5432
databaseTrueSTRINGTarget database name.postgres
usernameTrueSTRINGDatabase user name.postgres
passwordTruePASSWORDDatabase user password. Keep this secure.
schemaTrueSTRINGDefault schema to use. If set to 'public', it will not be added to the URI query.public
sslmodeTrueCHOICESSL connection mode. Only added to the URI if not 'disable'.require

Outputs

FieldTypeDescriptionExample
textSTRINGThe constructed PostgreSQL connection string (URI).postgresql://postgres:@localhost:5432/postgres?sslmode=disable
jsonSTRINGJSON output (unused for successful construction; may contain error details on failure).
htmlHTMLHTML output (not used by this node; empty on success).
xlsxXLSXXLSX output (not used by this node; empty on success).
pdfPDFPDF output (not used by this node; empty on success).

Important Notes

  • The schema parameter is appended only when it is not 'public'.
  • The sslmode parameter is appended only when it is not 'disable'.
  • This node does not validate database connectivity; it only formats a connection string.
  • If your username or password contains special characters, ensure they are URL-encoded before use.
  • Handle secrets carefully. Avoid exposing passwords in logs, shared graphs, or UI screenshots.

Troubleshooting

  • If downstream nodes fail to connect, verify host, port, database, username, and password are correct, and that the server is reachable.
  • If authentication issues occur, confirm that sslmode matches your server's SSL requirements (e.g., 'require', 'verify-ca', or 'verify-full').
  • If special characters in credentials cause parsing errors, URL-encode the username and password.
  • If you see an error message in the JSON output slot, check for invalid or missing input values.