fix #38749, postgresql GRANT user's permission after createDatabase, …#38750
fix #38749, postgresql GRANT user's permission after createDatabase, …#38750skjnldsv merged 2 commits intonextcloud:masterfrom
Conversation
|
I’m not familiar enough with databases to review this |
kesselb
left a comment
There was a problem hiding this comment.
Thank you very much for your pull 👍
Could you please provide us some more information about your change?
I'm not familiar with PostgreSQL. Grant create does not work, before creating the database because the schema public does not exist?
|
I think we should remove the code to create database tables and users. |
Sorry, not familiar with PHP. This is the After container up, enter the container got error: |
|
I traced this bug.
In my opinion, create users & database & tables are very good functions, because most users are newbies, they don't have the ability to manage the database. But this function should be refactor, for example server/lib/private/Setup/PostgreSQL.php Lines 122 to 143 in 63bf207 owner to nextcloud database user and copy all the permission nextcloud database user.
I can do this job, but still try to figure out how to write the TEST & execute it. |
I would prefer that newbies learn how to create a database and database user ;) We have automated tests for PostgreSQL. The notable difference:
That means in our automated tests, we do not run the code to create a database table. This code path is apparently broken. The stack trace is a bit misleading. server/lib/private/Setup/PostgreSQL.php Line 65 in eb7b682 Here is the problem. We need to overwrite the dbname (like for |
|
This bug still exists, wish someone could review it. |
Yes the commit message, we try to follow the conventional commits spec: https://www.conventionalcommits.org/ Some examples:
|
…database exist when GRANT
add8bde to
7856a7e
Compare
|
Rebased and reviewed! Thanks for the hard work @whlsxl 💪 |
7856a7e to
67c52d2
Compare
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
…ensure database exist when GRANT