Child pages
  • cPanel API 1 Functions - Postgres::adddb

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

This function adds a PostgreSQL® database.

Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$add_postgresdb = $cpanel->api1('Postgres','adddb', array('cpusername_dbname') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 

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

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Postgres::adduser($FORM('dbname'))">
Expand
titleCommand Line
Code Block
languagebash
cpapi1 --user=username Postgres adddb cpusername_dbname

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote

Expand
titleOutput (none)
This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
dbnamestring

Required

The database name.

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

Warning
titleWarnings
  • 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.