Information About Unable to Register User-Defined Functions in RDS

Asked 2 years ago, Updated 2 years ago, 124 views

In RDS-postgresql, I would like to register the following user-defined functions, but I do not have superuser privileges, so I get an error.

db=>CREATE OR REPLACE FUNCTION "public".bitpoint4(bit) RETURNS int4AS'bitpoint4'LANGUAGE'internal';
ERROR:permission denied for language internal

If you don't give the rdsadmin role, the above doesn't seem to be successful, but RDS doesn't seem to be able to give the rdsadmin role either.

rds-db=>grant rdsadmin to postgres;
ERROR:must be superuser to alter superusers

I'm sorry, but if you know the workaround, could you please let me know?

aws postgresql

2022-09-30 21:44

1 Answers

I was able to do this by rewriting it to the same content in plpgsql and defining it.

CREATE OR REPLACE FUNCTION square_root (precision bit) RETURNS int AS$$
BEGIN
    RETURN precision;
END;
$$ LANGUAGE plpgsql;


2022-09-30 21:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.