Description

This function adds a PostgreSQL® database.

Examples


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

 

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

<cpanel Module="Postgres::adduser($FORM('dbname'))">
cpapi1 --user=username Postgres adddb cpusername_dbname

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
dbnamestring

Required

The database name.

The cPanel account username, an underscore (_), and the database 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

Returns

This function does not return output.