[Support] jj9987 - PostgreSQL


Recommended Posts

PostgreSQL-banner.png

Application: PostgreSQL @ https://www.postgresql.org/

DockerHub: https://hub.docker.com/_/postgres/

GitHub:

- Version 10: https://github.com/juusujanar/unraid-templates/blob/master/PostgreSQL10.xml

- Version 11: https://github.com/juusujanar/unraid-templates/blob/master/PostgreSQL11.xml

- Version 12: https://github.com/juusujanar/unraid-templates/blob/master/PostgreSQL12.xml

- Version 13: https://github.com/juusujanar/unraid-templates/blob/master/PostgreSQL13.xml

- Version 14: https://github.com/juusujanar/unraid-templates/blob/master/PostgreSQL14.xml

 

This template uses the official Postgres Docker image to quickly set up a relational database according to your configuration.

 

If you have any issues/questions/suggestions regarding this Docker or the template, feel free to contact here.

 

CHANGELOG (5th November 2021):

BREAKING CHANGE: Database volume paths now include version tag, e.g. `/mnt/cache/appdata/postgresql10` so you can run multiple instances with different versions at the same time.

BREAKING CHANGE: PostgreSQL 10 template got changed, this could have broken stuff on old users. I am not familiar with the template changes on older versions.

- Added PostgreSQL 12, 13 and 14 templates.

- Container names changed to lowercase and includes version, e.g. `postgresql14`. This should make it easier for using in custom networks.

- Brought the templates up to date with current schema version.

 

Previous changelogs:

Spoiler

 

 

Edited by jj9987
  • Upvote 1
Link to comment
  • 2 months later...

Thank you for this container. Working nicely without any extra effort.

 

One question though. The user and group ids are 999 in /mnt/user/appdata/postgres. I would like to map them unRAID's 99 and 100 for nobody and users. What are the variables of user and group id inside the container? PUID and PGID?

Link to comment
  • 6 months later...
  • 1 year later...
  • 5 weeks later...
  • 6 months later...
6 hours ago, trurl said:

I don't use this but how are you trying to access this folder in your appdata user share? 

I was installing DSMR-Reader and Postgres. I'm fine now. 

Was not able to access smb share to accss /mnt/user/appdata/postgres. Was able to access it with krusader and Unraid terminal console.

 

Had also problems to setup a postgres db, because i did it as root? some kind of error... after a while i found pgAdmin, created a db trough that GUI :) 

 

Is postgres 12, or 13? available? 

Link to comment
  • 3 months later...
On 10/8/2020 at 10:55 PM, Fallwater said:

My Postgres11 container is just this, it works with DSMR reader, it works. But i can't access the folder /mnt/user/appdata/postgres, I am a  noob, any help? 😄

 

ns3MrLD.png

Hello,

I'm running now this docker and I also can't access the folder.

I even created another folder and pointed to it, and after starting the docker, the folder gets inaccessible.

 

image.png.17648026ff2c5245ce7395cb8d41b29a.png

Link to comment
  • 2 weeks later...

I have Postgres10 and pgadmin4 working properly together. I want to schedule regular backups of my db. It looks like pgagent is the tool I need. I found these instructions for installing it in the postgres container, but I'm not well-versed in modifying containers from the console. Was wondering if anyone here has installed it, or if it could be added to the docker template (or a seperate postgres/pgagent container as seen on docker hub). The pgadmin4 docs mention setting up a deamon, but I'm not sure if that's necessary, or how to do it if it is. Just don't want to mess up my working setup. Any insight is appreciated.

  • Like 1
Link to comment
  • 1 month later...
  • 3 months later...

Hey I am having some issues with the Postgresql container. I am only using it for nextcloud as well as for a Davinci Resolve database (haven't used it well before this started happening).

I had previously moved the database folder off the cache when I split apart my cache drives. It regenerated a new database because the data folder was pointed to
/mnt/cache/appdata/postgres.

But I realized that error quickly deleted the new empty database on /mnt/cache/appdata/postgres and pointed the container at the original database which was now on /mnt/user/appdata/postgres and everything worked fine until these errors below started happening. I fixed it once before by using "touch" to create a new empty file with the name of the one that's missing but this does not seem to be a permanent solution.

 

Here are the container logs.

 

###### Original problem after restarting database to see if that would fix it. ######

PostgreSQL Database directory appears to contain a database; Skipping initialization

2021-07-01 19:32:01.480 PDT [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-07-01 19:32:01.480 PDT [1] LOG: listening on IPv6 address "::", port 5432
2021-07-01 19:32:01.622 PDT [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-07-01 19:32:01.650 PDT [25] LOG: database system was shut down at 2021-06-29 16:53:24 PDT
2021-07-01 19:32:01.760 PDT [25] LOG: could not link file "pg_wal/xlogtemp.25" to "pg_wal/000000010000000000000012": Function not implemented
2021-07-01 19:32:01.762 PDT [25] FATAL: could not open file "pg_wal/000000010000000000000012": No such file or directory
2021-07-01 19:32:01.763 PDT [1] LOG: startup process (PID 25) exited with exit code 1
2021-07-01 19:32:01.763 PDT [1] LOG: aborting startup due to startup process failure
2021-07-01 19:32:01.764 PDT [1] LOG: database system is shut down

###### After running `touch pg_wal/000000010000000000000012` 				######
###### Seems to work fine but eventually runs into the same issue. 			######
###### This time with more detail because it's before restarting container.	######

PostgreSQL Database directory appears to contain a database; Skipping initialization

2021-07-01 19:37:17.510 PDT [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-07-01 19:37:17.510 PDT [1] LOG: listening on IPv6 address "::", port 5432
2021-07-01 19:37:17.746 PDT [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-07-01 19:37:17.776 PDT [26] LOG: database system was shut down at 2021-06-29 16:53:24 PDT
2021-07-01 19:37:17.785 PDT [1] LOG: database system is ready to accept connections
2021-07-01 19:47:18.362 PDT [27] LOG: could not link file "pg_wal/000000010000000000000011" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 02:47:23.654 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 02:47:23.656 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 02:52:26.833 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 02:52:26.835 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 02:57:28.930 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 02:57:28.932 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:02:31.826 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:02:31.828 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:07:34.968 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:07:34.970 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:12:37.012 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:12:37.014 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:17:39.823 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:17:39.825 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:22:43.381 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:22:43.383 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:27:45.554 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:27:45.556 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:32:48.448 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:32:48.450 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:37:51.810 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:37:51.812 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:42:53.856 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:42:53.858 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:47:56.817 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:47:56.819 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:52:59.952 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:52:59.954 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 03:58:01.729 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 03:58:01.731 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:03:04.614 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:03:04.616 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:08:07.763 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:08:07.766 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:13:09.816 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:13:09.818 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:18:12.641 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:18:12.643 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:23:15.834 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:23:15.836 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:28:17.997 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:28:18.000 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:33:20.891 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:33:20.894 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:38:24.033 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:38:24.035 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:43:26.020 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:43:26.021 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:48:29.015 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:48:29.017 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:53:32.198 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:53:32.200 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 04:58:34.361 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 04:58:34.363 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:03:37.250 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:03:37.252 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:08:40.422 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:08:40.424 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:13:42.389 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:13:42.391 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:18:45.306 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:18:45.308 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:23:48.492 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:23:48.494 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:28:50.349 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:28:50.351 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:33:53.247 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:33:53.249 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:38:56.814 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:38:56.816 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:43:58.586 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:43:58.588 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:49:01.582 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:49:01.584 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:54:04.875 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:54:04.876 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 05:59:07.040 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 05:59:07.042 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:04:09.876 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:04:09.878 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:09:13.045 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:09:13.047 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:14:15.028 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:14:15.030 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:19:18.036 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:19:18.038 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:24:21.252 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:24:21.255 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:29:23.317 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:29:23.320 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:34:26.151 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:34:26.154 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:39:29.362 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:39:29.364 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:44:31.450 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:44:31.451 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:49:34.343 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:49:34.346 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:54:37.518 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:54:37.519 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 06:59:39.492 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 06:59:39.495 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:04:42.431 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:04:42.433 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:09:45.606 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:09:45.608 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:14:47.719 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:14:47.721 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:19:51.452 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:19:51.454 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:24:53.793 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:24:53.795 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:29:55.893 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:29:55.895 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:34:58.950 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:34:58.952 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:40:01.975 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:40:01.977 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:45:04.779 PDT [27] LOG: could not link file "pg_wal/xlogtemp.27" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:45:04.781 PDT [27] ERROR: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:45:50.366 PDT [1046] LOG: could not link file "pg_wal/xlogtemp.1046" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:45:50.368 PDT [1046] PANIC: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:45:50.369 PDT [1] LOG: server process (PID 1046) was terminated by signal 6: Aborted
2021-07-02 07:45:50.369 PDT [1] DETAIL: Failed process was running: autovacuum: ANALYZE public.oc_jobs
2021-07-02 07:45:50.369 PDT [1] LOG: terminating any other active server processes
2021-07-02 07:45:50.369 PDT [30] WARNING: terminating connection because of crash of another server process
2021-07-02 07:45:50.369 PDT [30] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2021-07-02 07:45:50.369 PDT [30] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2021-07-02 07:45:50.373 PDT [1] LOG: all server processes terminated; reinitializing
2021-07-02 07:45:50.388 PDT [1047] LOG: database system was interrupted; last known up at 2021-07-02 07:45:04 PDT
2021-07-02 07:45:50.786 PDT [1047] LOG: database system was not properly shut down; automatic recovery in progress
2021-07-02 07:45:50.825 PDT [1047] LOG: redo starts at 0/12FFDAB0
2021-07-02 07:45:50.826 PDT [1047] LOG: redo done at 0/12FFDBC8
2021-07-02 07:45:50.989 PDT [1047] LOG: could not link file "pg_wal/xlogtemp.1047" to "pg_wal/000000010000000000000013": Function not implemented
2021-07-02 07:45:50.992 PDT [1047] FATAL: could not open file "pg_wal/000000010000000000000013": No such file or directory
2021-07-02 07:45:50.993 PDT [1] LOG: startup process (PID 1047) exited with exit code 1
2021-07-02 07:45:50.993 PDT [1] LOG: aborting startup due to startup process failure
2021-07-02 07:45:50.996 PDT [1] LOG: database system is shut down

 

Link to comment

@avlec,

I see isssues with linking in the logs. As you moved it from the cache (direct filesystem acces) to /mnt/user (fuse filesystem), maybe the function that it wants to use for linking is not working.
I suggest moving it back to /mnt/cache or if you prefer directly on a single array drive using /mnt/diskX and see if it solves the issue to confirm its related to the undelying filesystem.
I also use postgresql dockers on unraid for my davinci resolve database and now running it on zfs and before directly on /mnt/cache . Never tried it on the array filesystem /mnt/user

Link to comment
  • 1 month later...

I have an instance of Postgres11 set up and working with one application. Now I am looking to install a second application (Joplin) that also needs its own PostgreSQL database. What is the best way to do this? Having two apps share one database feels like a bad idea. Can I create a second database within one instance of Postgres11, or do I need to install a second instance?

Thanks!

Edited by Team_Dango
Link to comment
  • 1 month later...

Hi !

I'm using a Postgres container to get my Nextcloud Database running, I followed some tutorials here and there when I set it all up, all was working great.

This morning, Postgres was not running, checked the logs :

 

Quote

2021-10-01 10:06:03.493 CEST [1] FATAL: database files are incompatible with server
2021-10-01 10:06:03.493 CEST [1] DETAIL: The data directory was initialized by PostgreSQL version 13, which is not compatible with this version 14.0 (Debian 14.0-1.pgdg110+1).

 

My container was using the postgres:latest tag, so I guess it auto-updated to the latest 14 version.

Switched back to tag postgres:13.4 , all is working.

 

Question is, what should I do ? Leave it as is and stay on the 13.4 version for a while (or forever ?), or seek a solution to update database to 14.0 so it could be compatible ?

 

i'm a bit of a noob with this, maybe I didn't understand the problem correctly, but any reference site or procedure to follow could help me, and any advice is welcome :)

 

Thanks for your help !!

Link to comment
On 8/20/2021 at 3:46 AM, Team_Dango said:

I have an instance of Postgres11 set up and working with one application. Now I am looking to install a second application (Joplin) that also needs its own PostgreSQL database. What is the best way to do this? Having two apps share one database feels like a bad idea. Can I create a second database within one instance of Postgres11, or do I need to install a second instance?

Thanks!

It's absolutely okay to use one database instance with multiple databases for multiple apps. You will just have to create the new databases (and preferably also new roles) through the psql shell.

 

6 minutes ago, AmokK said:

Hi !

I'm using a Postgres container to get my Nextcloud Database running, I followed some tutorials here and there when I set it all up, all was working great.

This morning, Postgres was not running, checked the logs :

 

 

My container was using the postgres:latest tag, so I guess it auto-updated to the latest 14 version.

Switched back to tag postgres:13.4 , all is working.

 

Question is, what should I do ? Leave it as is and stay on the 13.4 version for a while (or forever ?), or seek a solution to update database to 14.0 so it could be compatible ?

 

i'm a bit of a noob with this, maybe I didn't understand the problem correctly, but any reference site or procedure to follow could help me, and any advice is welcome :)

 

Thanks for your help !!

 

Postgres upgrades can't be done by simply changing the version tags, they often have changes that require additional steps (e.g. pg_upgrade). So definitely don't use the latest tag. I changed the templates long time ago, haven't added newer templates to the repo though.

Here's the information on how to do it: https://www.postgresql.org/docs/14/upgrading.html

  • Like 1
Link to comment
3 minutes ago, jj9987 said:

Postgres upgrades can't be done by simply changing the version tags, they often have changes that require additional steps (e.g. pg_upgrade). So definitely don't use the latest tag. I changed the templates long time ago, haven't added newer templates to the repo though.

Here's the information on how to do it: https://www.postgresql.org/docs/14/upgrading.html

 

Thank you for your answer, I understand now why it can't work automatically, as it is a major postgres update.

I will stick to the 13.4 version for the moment, as the database upgrade procedure seems a little bit complicated, but I will study it thoroughly and try it later :) 

 

Link to comment
Just now, AmokK said:

 

Thank you for your answer, I understand now why it can't work automatically, as it is a major postgres update.

I will stick to the 13.4 version for the moment, as the database upgrade procedure seems a little bit complicated, but I will study it thoroughly and try it later :) 

 

The upgrade is sorta complicated, you need both old and new binaries available, which the official docker images do not provide. Backup and restore might be more convenient and easier.

  • Like 1
Link to comment
On 10/1/2021 at 3:27 AM, AmokK said:

 

Thank you for your answer, I understand now why it can't work automatically, as it is a major postgres update.

I will stick to the 13.4 version for the moment, as the database upgrade procedure seems a little bit complicated, but I will study it thoroughly and try it later :) 

 

 

I too use psql for nextcloud, and while I'm no db expert.. let alone psql, I just went through the process after fiddling with it for a while, only made complicated by docker really.

 

Just spin up 2 psql containers with separate appdata dirs, original being port 5432, new one 5433.

Mount a shared backup directory between them.

SSH into the OG psql, run 'pg_dumpall -U postgres > /backupdir/all.sql'

SSH into the NEW psql, recreate any users you had before (not entirely sure this needs to be done but I did), then run 'psql -U postgres -f /backupdir/all.sql'

Kill the old container, change the new container port to whatever the old one was, 5432 in this case.

Done

 

I'm sure someone will tell me why this is a horrible way to do it, but hey it worked.

  • Like 2
Link to comment
  • 4 weeks later...

Hello, recently made the error of deleting my Postgres11 docker instead of the pgAdmin 4 docker to which I lost the password for, I got the two dockers working again except I don't have my data it seems. I had two database for Szurubooru, one might be lost (lame but oh well) but the other shouldn't have been affected by me fumbling around with reinstalling the postgres docker. Post above for avlec were the solution basicly. However I'm not too sure about how to link/add the second database so the postgres docker can see it. Any simple way to add it back from pgAdmin? Or even not so simple ways

Edit: Suggestion on how to set up auto backup/snapshot for the docker image so I can more easily fix that kind of screw up in the future also welcome.

Edited by Eddyall
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.