Queries the attributes that are supported by PolarDB for PostgreSQL(Compatible with Oracle) or PolarDB for PostgreSQL databases, such as the character sets and collations.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeDBInitializeVariable

The operation that you want to perform. Set the value to DescribeDBInitializeVariable.

DBClusterIdStringYespc-****************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the information of all clusters that are deployed in a specified region, including the cluster IDs.

Response parameters

ParameterTypeExampleDescription
VariablesArray of Variable

The result data that is returned.

Variable
CharsetStringEUC_CN

The character set that is supported.

CollateStringC

The language that specifies the collation of the database that is to be created.

Note
  • The language must be compatible with the character set that is specified by the CharacterSetName parameter.
  • This parameter is required if your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster.
  • This parameter is not required if your cluster is a PolarDB for MySQL cluster.

To view the valid values of this parameter, perform the following steps: Log on to the PolarDB console and click the ID of a cluster. In the left-side navigation pane, choose Settings and Management > Databases. Then, click Create Database.

CtypeStringC

The language that specifies the character type of the database.

Note
  • The language must be compatible with the character set that is specified by the CharacterSetName parameter.
  • The value of this parameter must be the same as the value of the Collate parameter.
  • This parameter is required if your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster.
  • This parameter is not required if your cluster is a PolarDB for MySQL cluster.

To view the valid values of this parameter, perform the following steps: Log on to the PolarDB console and click the ID of a cluster. In the left-side navigation pane, choose Settings and Management > Databases. Then, click Create Database.

DBVersionString11

The version of the database engine.

RequestIdString475F58B7-F394-4394-AA6E-4F1CBA******

The ID of the request.

DBTypeStringPostgreSQL

The type of the database. Valid values:

  • Oracle
  • PostgreSQL

Examples

Sample requests

http(s)://polardb.aliyuncs.com/?Action=DescribeDBInitializeVariable
&DBClusterId=pc-****************
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ResponseResponse>
    <Variables>
        <Variable>
            <Charset>EUC_CN</Charset>
            <Collate>C</Collate>
            <Ctype>C</Ctype>
        </Variable>
        <Variable>
            <Charset>EUC_CN</Charset>
            <Collate>POSIX</Collate>
            <Ctype>POSIX</Ctype>
        </Variable>
    </Variables>
    <DBVersion>11</DBVersion>
    <RequestId>475F58B7-F394-4394-AA6E-4F1CBA1F2FE8</RequestId>
    <DBType>PostgreSQL</DBType>
</ResponseResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Variables" : {
    "Variable" : [ {
      "Charset" : "EUC_CN",
      "Collate" : "C",
      "Ctype" : "C"
    }, {
      "Charset" : "EUC_CN",
      "Collate" : "POSIX",
      "Ctype" : "POSIX"
    } ]
  },
  "DBVersion" : "11",
  "RequestId" : "475F58B7-F394-4394-AA6E-4F1CBA1F2FE8",
  "DBType" : "PostgreSQL"
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidDBClusterId.NotFoundThe DBClusterId provided does not exist in our records.The error message returned because the specified cluster ID does not exist in the current record.

For a list of error codes, see Service error codes.