External Database Migration Issue: Permission Denied

Product version: 10.11

Last modified: 16 July 2024

Problem

During the external database migration process, the following error message is displayed:

Permission denied for schema public (PSQLException)

Background

Starting from PostgreSQL 15, the CREATE permission has been revoked from all users except for a database owner from the public (or default) schema.

Solution

To resolve the permission issue, do the following:

GRANT ALL ON SCHEMA public TO <username>

Create DB Role Problem

During the migration process to the PostgreSQL, the following error message is displayed:

Permission denied to create database

Background

The user must have the "Create DB" role to perform migration. To check if you have the necessary role, under the PostgreSQL account issue the following command:

\du

Solution

To alter the role, use the following command:

ALTER ROLE <user> WITH CREATEDB;