Description

This function adds a PostgreSQL® database user to a database.

Examples


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

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

<cpanel Module="Postgres::adduserdb( $FORM('db','user'))">
cpapi1 --user=username Postgres adduserdb cpusername_dbname cpusername_dbusername

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
dbstring

Required

The database name.

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

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

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

Required

The database user.

The cPanel account's 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

Returns

This function does not return output.