n8n icon indicating copy to clipboard operation
n8n copied to clipboard

docs: Update docker-compose.yml example to Postgres 16 and update initialization script

Open johnyb0y opened this issue 1 year ago • 6 comments

Summary

Describe what the PR does and how to test. Photos and videos are recommended.

This PR updates the example docker-compose.yml to use Postgres version 16. Before this change it was Postgres 11, which is EOL since November 9, 2023.

Since the default permissions on the public schema have changed since Postgres 15, we also need to update the included Initialization script. Before, the insecure default was to allow everyone (PUBLIC) to create objects in schema public. Now only the database owner can do that, unless you grant extra privileges. Therefore we need do that for our POSTGRES_NON_ROOT_USER.

I have done a quick test deployment and created some example workflows and found no problems.

Edit: I also looked at the docs and only found a mentioned link to the docker-compose.yml example file in the github repo, which doesn't need to be updated.

Related tickets and issues

Include links to Linear ticket or Github issue or Community forum post. Important in order to close automatically and provide context to reviewers.

Review / Merge checklist

  • [x] PR title and summary are descriptive. Remember, the title automatically goes into the changelog. Use (no-changelog) otherwise. (conventions)
  • [x] Docs updated or follow-up ticket created.
  • [ ] Tests included.

    A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests.

johnyb0y avatar Jan 29 '24 19:01 johnyb0y

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jan 29 '24 19:01 CLAassistant

Hey @johnyb0y,

Thanks for the PR, Would you be able to update the other example that uses Postgres as well?

Joffcom avatar Feb 07 '24 10:02 Joffcom

Hey @johnyb0y,

Thanks for the PR, Would you be able to update the other example that uses Postgres as well?

Hi @Joffcom Sure. I appended the commits on this PR.

johnyb0y avatar Feb 07 '24 17:02 johnyb0y

Thanks @johnyb0y, This looks good to me but just to be safe I would like to ask @netroy to give it a quick review as well, I believe he is out today and will be back tomorrow so another couple of days and this should be good to go.

Joffcom avatar Feb 13 '24 09:02 Joffcom

@Joffcom Sure, no problem. Please let me know if I can be of further help here.

johnyb0y avatar Feb 13 '24 09:02 johnyb0y

This PR is simply meant as an update to the current docker installation method. Both docker examples are currently linked in the documentation on how to do a fresh installation of n8n.

I cannot provide upgrade instructions for existing docker installations.

Upgrading an existing database can be non-trivial and things can go wrong (as I'm sure you all know).

johnyb0y avatar Feb 14 '24 17:02 johnyb0y

That is valid, I also think changing database versions is outside of our scope and the user should refere to the documentation provided by their database of choice.

Joffcom avatar Feb 21 '24 14:02 Joffcom

Thinking about it some more, maybe we can meet somewhere in the middle. We could add a general notice somewhere in the docs which refers the user to official instructions on how upgrading a Postgres database works in general. Regardless of if it is a dockerized database or not. What do you think?

johnyb0y avatar Feb 21 '24 15:02 johnyb0y

@johnyb0y I was thinking the same, and was trying to figure out where to put such a notice to that anyone who uses the compose file directly from this repo can be informed about this change. What I mean is that if someone pulls the updated compose file, and runs a docker compose create (or something else to update their containers), we need a way to inform them why the setup doesn't work anymore. I'll take care of this, and will get this PR merged soon. Sorry for the delays so far.

netroy avatar Feb 21 '24 15:02 netroy

How about this then: I could add a general comment inside of the compose file that the version of postgres needs to be pinned to a major version like "16" and that upgrading an existing Postgres database requires more steps than changing the version number inside the compose file. With a referral to official Postgres upgrade instructions.

If that sounds good to you I could amend this PR. Otherwise we can go with your suggestion.

johnyb0y avatar Feb 21 '24 15:02 johnyb0y

Got released with [email protected]

janober avatar Feb 28 '24 15:02 janober