PostgreSQL Permission Issues on new Table

Wappler Version : 6.0.0 Beta 8
Operating System : Windows 10
Server Model: NodeJS
Database Type: PostgreSQL
Hosting Type: Docker

Expected behavior

What do you think should happen?

When deploying a new PostgreSQL service, creating a database, creating a user. Assign the user permissions to the new database. We should be able to create new tables.

Actual behavior

What actually happens?

When creating a new table and applying database changes I receive a permission error.

Database Changes Failed due to an error!

Error: create table “wappler_migrations” (“id” serial primary key, “name” varchar(255), “batch” integer, “migration_time” timestamptz - permission denied for schema public.

image

How to reproduce

  • Detail a step by step guide to reproduce the issue
  • A screenshot or short video indicating the problem
  • A copy of your code would help. Include: JS, HTML.
  • Test your steps on a clean page to see if you still have an issue

Create new project, create new PostgreSQL in docker on local or cloud. Create new table.

I cannot test on an earlier version such as 5.8.2 as I get the spinning loading bug when trying to load in anything with PostgreSQL that has been fixed in the beta version.

I’ve followed the same procedure I’ve done before with MariaDB without issues. If I am doing it wrong here please let me know.

Thanks

To follow up on this. On PostgreSQL version 14.8.x it does not have this issue, it is only on version 15.3.x where it has this problem. From my reading on the issue on version 15 and above permissions have changed on the public schema.

Also to add onto this, there does not seem to be a change history or seed as I would see in MySQL or MariaDB. Is that correct for PostgreSQL?

It seems to me that the user login you are using for the database access doesn’t have enough permissions to access the public database. Make sure it is authorized there as well.

Is there something else I need to be doing aside from creating the database creating the user, then clicking on the database and granting access to the user?

So looking further into the differences between 14 and 15, seems on version 15 we need to do additional steps for the public schema?

I had to login via a console and

GRANT ALL ON SCHEMA public TO newuser;

After that I can then create tables on 15. Is this the correct method to accomplish this? Are there no change history in PostgreSQL? Under public all I have are tables and views.

Thanks

Yes that is correct way to do. I will also check the default permissions done when creating databases and adding users to Postgres databases with the Resource Manager and make sure this is automatically done.

Thanks for the reply. Lastly regarding the changes and seeds that we would normally see on MySQL and MariaDB is that supposed to be there for PostgreSQL or am I missing other permissions? See my screenshot below.

image

I can see that a wappler migrations table was created it seems.

image

Aeems all ok to me, yes the migration tables are created automatically.

Are you missing something?

For example in SQLite, MySQL, and MariaDB I would see Changes and Seeds under Views. Is that not a thing for PostgreSQL? I am still pretty new to Wappler so still learning all the details of each database.

Thanks