Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql ERROR: must be superuser to create a base type

I am trying to create custom data type as below

CREATE TYPE _kitdatatype (
    INPUT = array_in,
    OUTPUT = array_out,
    RECEIVE = array_recv,
    SEND = array_send,
    ANALYZE = array_typanalyze,
    ALIGNMENT = 4,
    STORAGE = any,
    CATEGORY = A,
    ELEMENT = kitdatatype,
    DELIMITER = ',');

The database instance is deployed on AWS and I am connecting Postgres user but getting below error.

SQL Error [42501]: ERROR: must be superuser to create a base type
like image 312
Rahul Neekhra Avatar asked Dec 19 '25 10:12

Rahul Neekhra


1 Answers

Yes as per postgresql docs you need to be superuser.

To create a new base type, you must be a superuser. (This restriction is made because an erroneous type definition could confuse or even crash the server.)

To make superuser in aws run these commands

create role your_user with password 'your_password' login;   
CREATE ROLE   
grant rds_superuser to testuser;   
GRANT ROLE  
like image 92
Saurabh Nigam Avatar answered Dec 21 '25 03:12

Saurabh Nigam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!