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.

Permission denied for database CREATE SCHEMA IF NOT EXISTS

See original GitHub issue

Running dataContext.Database.Migrate(); with a user that has no CREATE SCHEMA rights will fail even if the given schema exists and the migrationBuilder.EnsureSchema(name: "customshema"); line is commented out of the migration file.

This is a problem since in our instance the application is run by a user who only has owner rights for his own schema.

All tables and migration history table are in the same schema (not public). Npgsql.EntityFrameworkCore.PostgreSQL Version="3.1.4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rojicommented, Dec 15, 2021

@meronz take a look at #1770 - there are some workarounds there on how to deal with it. I’m looking into a change (#2150) which would fix this without any need for a workaround.

0reactions
rojicommented, Dec 15, 2021

Duplicate of #1770

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the required to make a normal user can create ...
1 Answer. Grant the user CREATE privilege on the database, e.g. The CREATE privilege, when applied to an existing database, enables the User...
Read more >
User cannot create schema in PostgresSQL database
I'm trying to setup a "deployment" user which can create and alter tables on an existing database in addition to selecting, updating, inserting ......
Read more >
dbt tries to create schema which already exists, as user with ...
I'm trying to create a model in an existing schema. However, on run, dbt runs “CREATE SCHEMA {} IF NOT EXISTTS”. The user...
Read more >
Documentation: 15: CREATE SCHEMA
CREATE SCHEMA enters a new schema into the current database. The schema name must be distinct from the name of any existing schema...
Read more >
How do I resolve a "permission denied for schema public ...
The job is erroring out during a step where we create a few tables within our database using <user>: peewee.ProgrammingError: permission denied ......
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