Why Did I Fail to Create an Object on the postgres Database as a Common User?
Symptom
- Creating a Schema as a Common User
Command: CREATE SCHEMA my_schema;
Error: ERROR: permission denied for database postgres
- Creating a Table as a Common User
Command: CREATE TABLE my_table(id int PRIMARY KEY,name VARCHAR(30));
ERROR: permission denied for schema public
Solution
A common user cannot create objects on the postgres database, but a root user can.
![](https://support.huaweicloud.com/intl/en-us/rds_faq/public_sys-resources/note_3.0-en-us.png)
Switch to user root and ensure that your database kernel allows for root privilege escalation. For details, see Privileges of the root User.
Privileges of the root User
RDS for PostgreSQL provides permissions for the root user. To create objects on an RDS for PostgreSQL database without operation risks, escalate your account to root privileges when necessary.
The following table describes root privilege escalation in different versions.
Version |
Whether to Escalate Privileges |
Initial Version for Privilege Escalation |
---|---|---|
pgcore9 |
No |
N/A |
pgcore10 |
No |
N/A |
pgcore11 |
Yes |
11.11 |
pgcore12 |
Yes |
12.6 |
pgcore13 |
Yes |
13.2 |
pgcore14 |
Yes |
14.4 |
pgcore15 |
Yes |
15.4 |
pgcore16 |
Yes |
16.2 |
Escalate to root privileges when you need to:
- Create an event trigger.
- Create a wrapper.
- Create a logical replication publication.
- Create a logical replication subscription.
- Query and maintain replication sources.
- Create a replication user.
- Create a full-text index template and parser.
- Run the vacuum command on a system table.
- Run the analyze command on a system table.
- Create a plugin.
- Grant an object permission to a user.
Database Permission FAQs
- Why Does the Root User Not Have the Super Permissions?
- What Are the Differences Between RDS ManageAccess and DAS Permissions?
- RDS for MySQL Built-in Accounts
- RDS for MariaDB Built-in Accounts
- Does RDS for MySQL Support Multiple Accounts?
- Can Multiple Users Log In to DAS at the Same Time? Will the Accounts Be Locked If I Enter Wrong Passwords Several Times in a Row?
- Why Did I Fail to Create an Object on the postgres Database as a Common User?
- What Should I Do If a Role Failed to Be Deleted from an RDS for PostgreSQL Instance?
- Why Did My RDS for PostgreSQL Migration Fail?
- How Do I Grant the REPLICATION Permission to an RDS for PostgreSQL Database User?
- Why Is An Error Reported When I Attempt to Change a Table Owner of My RDS for PostgreSQL Instance?
- How Are the Login Name Permissions of RDS for SQL Server 2017 Enterprise Edition Primary/Standby DB Instances Synchronized to Its Read Replicas?
- After a Primary Instance Account Is Deleted and Recreated on RDS for SQL Server, Will the Permissions Be Automatically Synchronized?
- How Do I View Authorized Databases After a Local Client Is Connected to a DB Instance?
- How Do I Create Accounts and Databases After Purchasing a DB Instance?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore