seitime-frappe/frappe/database/postgres
hhharsha36 445da4319b
fix: error - permission denied for schema public from Postgres >= 15 during initial DB setup (#23799)
Error from Postgres:
ERROR:  permission denied for schema public at character 14

Error from Frappe:
psql:/home/frappe/frappe-bench/apps/frappe/frappe/database/postgres/framework_postgres.sql:72: ERROR:  permission denied for schema public

Error Causer:
Starting Postgres version >= 15, all users will have the `CREATE` permission revoked by default.

Fix:
Grant relevant privileges to the database in question for the user. In this case, DB owner privilege.

Note: the below two permission attempts were unsuccessful and still caused the same public schema permission error

GRANT USAGE, CREATE ON SCHEMA public TO {frappe.conf.db_name};
GRANT ALL ON SCHEMA public TO {frappe.conf.db_name}

References:
https://stackoverflow.com/questions/74110708/postgres-15-permission-denied-for-schema-public
https://stackoverflow.com/questions/67276391/why-am-i-getting-a-permission-denied-error-for-schema-public-on-pgadmin-4
2023-12-27 16:04:21 +05:30
..
__init__.py Postgres support for Frappe (#5919) 2018-09-21 10:20:48 +05:30
database.py Do not call begin in updatedb after syncing (#23934) 2023-12-26 12:12:19 +05:30
framework_postgres.sql chore!: drop device support from session (#18729) 2022-12-05 16:37:32 +05:30
schema.py refactor(treewide): code cleanup 2023-11-23 13:57:51 +05:30
setup_db.py fix: error - permission denied for schema public from Postgres >= 15 during initial DB setup (#23799) 2023-12-27 16:04:21 +05:30