Skip to content

PostgreSQL Connection String

Constructs a PostgreSQL connection URI from individual parameters. It concatenates host, port, database, username, and password into a standard postgresql:// URI and appends optional sslmode and schema query parameters when provided.
Preview

Usage

Use this node when you need a ready-to-use PostgreSQL connection string to pass into downstream nodes, services, or configuration fields. It is ideal for workflows that collect connection details interactively and then require a single DSN-style string.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase hostname or IP address.db.example.com
portTrueINTDatabase port number.5432
databaseTrueSTRINGTarget database name.my_database
usernameTrueSTRINGDatabase user name for authentication.db_user
passwordTruePASSWORDPassword for the provided database user.
schemaTrueSTRINGSchema name to include as a query parameter. If set to the default 'public', it will be omitted from the URI.analytics
sslmodeTrueSTRINGSSL connection mode to include as a query parameter. If 'disable', it will be omitted from the URI.require

Outputs

FieldTypeDescriptionExample
textSTRINGThe constructed PostgreSQL connection URI.postgresql://db_user:@db.example.com:5432/my_database?sslmode=require&schema=analytics
jsonSTRINGEmpty string (not used by this node).
htmlSTRINGEmpty string (not used by this node).
xlsxBYTESEmpty bytes (not used by this node).
pdfBYTESEmpty bytes (not used by this node).

Important Notes

  • Security: The returned URI includes the password in plain text; avoid displaying or logging it. Use secure storage/handling.
  • Encoding: If your username or password contains special characters, they may need URL-encoding to form a valid URI.
  • Optional params: The 'sslmode' and 'schema' parameters are appended only if different from their defaults ('disable' and 'public' respectively).
  • Connectivity: This node does not validate or test the connection; errors will surface when a downstream process attempts to connect.
  • Schema behavior: Not all drivers honor a 'schema' query parameter. You may need to set search_path or driver-specific options if the schema is not applied.

Troubleshooting

  • Downstream connection fails: Verify host, port, database, username, and password are correct and that the database is reachable from your environment.
  • Authentication errors: Check for typos and ensure any special characters in credentials are URL-encoded.
  • SSL issues: If the server requires SSL, set 'sslmode' to 'require' or stricter ('verify-ca', 'verify-full'). Ensure certificates are configured as required by your client.
  • Schema not applied: If objects are not found in the intended schema, confirm whether your client honors the 'schema' query parameter. Consider setting the search_path or using a driver-specific parameter.