connectPsqlDatabase

connectPsqlDatabase#

connectPsqlDatabase(databaseName, serverName, port, username, password, isDisply)#

Establish a PostgreSQL database connection with specified credentials.

Creates a native PostgreSQL connection using the provided server details and credentials. Tests the connection before returning and displays connection status information.

Parameters:
  • databaseName (string) – Name of the target database

  • serverName (string) – PostgreSQL server hostname or IP address

  • port (double) – Server port number (typically 5432)

  • username (string) – Database username

  • password (string) – Database password

  • isDisply (logical, optional) – Display connection status messages (default: true)

Returns:

Established PostgreSQL database connection

Return type:

database.postgre.connection

Example:

conn = connectPsqlDatabase("myDB", "localhost", 5432, "user", "pass");