question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using postgres permissions from docs does not work on RDS

See original GitHub issue

via fusillicode#3122 on Discord.

Following the instructions here does not work on RDS.

Results in error:

sql> GRANT SELECT ON ALL TABLES IN SCHEMA information_schema TO hasurauser
[2019-02-28 13:03:13] [42501] ERROR: permission denied for relation sql_parts
sql> GRANT SELECT ON ALL TABLES IN SCHEMA pg_catalog TO hasurauser
[2019-02-28 13:03:17] [42501] ERROR: permission denied for relation pg_statistic

Probably because RDS restricts specific tables in pg_catalog and information_schema.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:20
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
denisotaricommented, Feb 19, 2020

The following DDLs doesn’t raise any errors from the db side:

GRANT SELECT ON information_schema.table_constraints, information_schema.key_column_usage, information_schema.columns, information_schema.views, information_schema.schemata, information_schema.routines TO <hasura-username>;

GRANT SELECT ON pg_catalog.pg_constraint, pg_catalog.pg_class, pg_catalog.pg_namespace, pg_catalog.pg_attribute, pg_catalog.pg_proc, pg_catalog.pg_available_extensions, pg_catalog.pg_statio_all_tables, pg_catalog.pg_description TO <hasura-username>;

Regarding the pg_catalog tables I’ve just found this thread but it doesn’t explains much about the issue: https://stackoverflow.com/questions/45095211/amazon-rds-postgres-give-permission-to-pg-catalog

In my case GCP CloudSQL PostgreSQL 9.6.15 return error:

WARNING:  no privileges were granted for "table_constraints"
WARNING:  no privileges were granted for "key_column_usage"
WARNING:  no privileges were granted for "columns"
WARNING:  no privileges were granted for "views"
WARNING:  no privileges were granted for "schemata"
WARNING:  no privileges were granted for "routines"
WARNING:  no privileges were granted for "pg_constraint"
WARNING:  no privileges were granted for "pg_class"
WARNING:  no privileges were granted for "pg_namespace"
WARNING:  no privileges were granted for "pg_attribute"
WARNING:  no privileges were granted for "pg_proc"
WARNING:  no privileges were granted for "pg_available_extensions"
WARNING:  no privileges were granted for "pg_statio_all_tables"
WARNING:  no privileges were granted for "pg_description"
GRANT

Query returned successfully in 148 msec.
2reactions
koienergyspacommented, Apr 29, 2020

The following DDLs doesn’t raise any errors from the db side:

GRANT SELECT ON information_schema.table_constraints, information_schema.key_column_usage, information_schema.columns, information_schema.views, information_schema.schemata, information_schema.routines TO <hasura-username>;

GRANT SELECT ON pg_catalog.pg_constraint, pg_catalog.pg_class, pg_catalog.pg_namespace, pg_catalog.pg_attribute, pg_catalog.pg_proc, pg_catalog.pg_available_extensions, pg_catalog.pg_statio_all_tables, pg_catalog.pg_description TO <hasura-username>;

Regarding the pg_catalog tables I’ve just found this thread but it doesn’t explains much about the issue: https://stackoverflow.com/questions/45095211/amazon-rds-postgres-give-permission-to-pg-catalog

Using AWS Amazon RDS PostgreSQL 12 returns this:

postgres=> GRANT SELECT ON pg_catalog.pg_constraint, pg_catalog.pg_class, pg_catalog.pg_namespace, pg_catalog.pg_attribute, pg_catalog.pg_proc, pg_catalog.pg_available_extensions, pg_catalog.pg_statio_all_tables, pg_catalog.pg_description TO hasurauser;

WARNING:  no privileges were granted for "pg_constraint"
WARNING:  no privileges were granted for "pg_class"
WARNING:  no privileges were granted for "pg_namespace"
WARNING:  no privileges were granted for "pg_attribute"
WARNING:  no privileges were granted for "pg_proc"
WARNING:  no privileges were granted for "pg_available_extensions"
WARNING:  no privileges were granted for "pg_statio_all_tables"
WARNING:  no privileges were granted for "pg_description"
GRANT
Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding PostgreSQL roles and permissions
In PostgreSQL, a role can define a user, a group, or a set of specific permissions granted to a group or user for...
Read more >
Documentation: 15: COPY - PostgreSQL
If a column list is specified, COPY TO copies only the data in the specified columns to the file. For COPY FROM ,...
Read more >
Troubleshooting DB issues for Amazon RDS Custom
Learn how to troubleshoot issues with Amazon RDS Custom DB instances. ... The caller doesn't have permissions to get files from your S3...
Read more >
Postgres EDB and PostgreSQL Setup | Enterprise Docs
If you are using Postgres for Amazon RDS or for Aurora, the admin user they provide is NOT a true superuser and its...
Read more >
Configure GitLab using an external PostgreSQL service
To resolve this error, ensure that you are meeting the minimum PostgreSQL requirements. After upgrading your RDS instance to a suitable version, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found