Giter Club home page Giter Club logo

Comments (4)

tshatrov avatar tshatrov commented on May 16, 2024 1

Sure, go ahead!

from ichiran.

fasiha avatar fasiha commented on May 16, 2024

I found a workaround! I simply asked pg_restore to ignore the roles (via --no-owner --no-privileges), deleted the docker/pgdata, rebuilt the container and reran compose, and everything works!

So step 1, apply this patch:

diff --git a/docker/postgres-initdb/ichiran-db.sh b/docker/postgres-initdb/ichiran-db.sh
index dbe2c55..8aa9800 100644
--- a/docker/postgres-initdb/ichiran-db.sh
+++ b/docker/postgres-initdb/ichiran-db.sh
@@ -4,7 +4,7 @@ echo "========================="
 
 createdb -E 'UTF8' -l 'ja_JP.utf8' -T template0 dummy
 set +e
-pg_restore -C -d dummy /ichiran.pgdump
+pg_restore -C -d dummy /ichiran.pgdump --no-owner --no-privileges
 
 echo "========================="
 echo "Finished ichiran DB init!"

Then,

$ rm docker/pgdata && docker-compose build pg && docker compose up

I waited about ~half hour, watched du -h -d0 docker/pgdata tick up to 4.4 GB, before everything was ready.

I'm not a Postgres expert, any tips on what impact --no-owner --no-privileges has? Can I possibly create the ichiran role now, that the database has initialized, and then future restores will work unmodified? Or is the best thing to do is for the release process to somehow include roles in the dump file?

from ichiran.

tshatrov avatar tshatrov commented on May 16, 2024

I believe "role doesn't exist" error is normal and shouldn't affect anything. It's expected when restoring a database dump on a different machine. I don't use docker myself so not sure about the other issues

from ichiran.

fasiha avatar fasiha commented on May 16, 2024

Thanks for confirming @tshatrov! Do you want a one-line PR with the fix I mentioned above to make the Docker instructions work?

from ichiran.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.