Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon RDS Postgres -> Give permission to pg_catalog

I need to grant permission to the master user(MasterUsername) the access of of pg_catalog.

GRANT USAGE ON SCHEMA pg_catalog TO <master-user>;

On running this, I get the below warning: WARNING: no privileges were granted for "pg_catalog".

Essentially, I have an automation script, where I create the database, I set search path and :

SET search_path = <my-schema>, pg_catalog;
CREATE TYPE <type> AS (
id bigint,
name character varying);

I get below error

Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for schema pg_catalog

Essentially, it's not allowing me to create type, since the pg_type table exists in pg_catalog. How to create type?

I don't know if granting the USAGE rights will help? If there's another way to work-around this, please do let me know.

like image 230
Pavanraotk Avatar asked Jul 14 '17 05:07

Pavanraotk


People also ask

How do I check Postgres schema permissions?

table_privileges WHERE grantee = 'userName'; This can give a detailed look on the table privileges.


1 Answers

granting usage rights will only let you be able to access objects of a schema, creating new objects will require create privileges on that schema.

like image 193
Lohit Gupta Avatar answered Oct 16 '22 06:10

Lohit Gupta