Skip to content

PostgreSQL Connection String

Constructs a PostgreSQL connection URI from discrete parameters (host, port, database, username, password, schema, sslmode). It concatenates these inputs into a standard postgresql:// URL and appends optional query parameters when specified.
Preview

Usage

Use this node whenever you need a correctly formatted PostgreSQL connection string for downstream database nodes or external tools. Provide your server details and credentials; the node outputs the URI in the text slot, ready to pass to connection or query nodes.

Inputs

FieldRequiredTypeDescriptionExample
hostTrueSTRINGDatabase hostname or IP address.db.example.com
portTrueINTDatabase port number (1–65535).5432
databaseTrueSTRINGTarget database name.app_db
usernameTrueSTRINGDatabase user name.postgres
passwordTruePASSWORDDatabase password for the provided user.
schemaTrueSTRINGDefault schema to target. If set to "public", it will not be added to the URI as a parameter.public
sslmodeTrue["disable", "require", "verify-ca", "verify-full"]SSL mode for the connection. Append as a query parameter if not "disable".require

Outputs

FieldTypeDescriptionExample
textSTRINGThe constructed PostgreSQL connection string in the form postgresql://username:password@host:port/database with optional ?schema= and/or &sslmode= parameters.postgresql://postgres:@db.example.com:5432/app_db?schema=analytics&sslmode=require
jsonSTRINGEmpty output for this node (not used).
htmlSTRINGEmpty output for this node (not used).
xlsxBYTESEmpty output for this node (not used).
pdfBYTESEmpty output for this node (not used).

Important Notes

  • Password safety: Do not expose real passwords in logs, prompts, or shared outputs. Use placeholders like "" in examples.
  • Schema handling: The schema parameter is only appended when it is not "public".
  • SSL mode: The sslmode parameter is appended only when not "disable". Choose the correct mode according to your server's TLS configuration.
  • Special characters: If the username or password contains special characters (e.g., @, /, :, ?), URL-encode them before use to avoid invalid URIs.
  • Validation: This node only constructs the URI; it does not validate connectivity or credentials.

Troubleshooting

  • Cannot connect using the URI: Verify the host, port, and database are reachable and correct. Ensure firewall and network rules allow access.
  • Authentication failed: Confirm the username/password are correct for the target database. If special characters are present, URL-encode them.
  • SSL errors: If the server requires TLS, set sslmode to "require" or stricter. For certificate validation, use "verify-ca" or "verify-full" and ensure certificates are configured on the client.
  • Wrong default schema used: If queries hit the wrong schema, set the schema input to the desired value (not "public") so it is appended to the connection string.