Description

This function adds a PostgreSQL® database user.

Examples


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_postgresuser = $cpanel->api1('Postgres','adduser', array('cpusername_dbusername','12345luggage') ); // Call the function.

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $add_postgresuser = $cpliveapi->api1('Postgres','adduser', ['cpusername_dbusername','12345luggage'] ); # Call the function.

<cpanel Module="Postgres::adduser( $FORM('user','password'))">
cpapi1 --user=username Postgres adduser cpusername_dbusername 12345luggage

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The database's name.

The cPanel username, an underscore (_), and the database user's name.

  • The maximum length of the database username is 63 bytes.
  • If the total length of the parameter exceeds the limit for database usernames, the function will fail.

  • If database prefixing is enabled, this parameter must include the database prefix for the account.
cpusername_dbusername
passwordstring

Required

The new database user's password.

A secure password.12345luggage

Returns

This function does not return output.