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 databaseserverName (
string) – PostgreSQL server hostname or IP addressport (
double) – Server port number (typically 5432)username (
string) – Database usernamepassword (
string) – Database passwordisDisply (
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");