Git Product home page Git Product logo

Comments (8)

tianon avatar tianon commented on June 29, 2024

Isn't this going to be application specific, especially since most apps will have some default schema and stuff to push in, too?

from postgres.

bfirsh avatar bfirsh commented on June 29, 2024

It's useful for the case where an application expects a database to exist and automatically populates it with tables.

from postgres.

yosifkit avatar yosifkit commented on June 29, 2024

The initdb that is run in the entrypoint when starting postgres automatically creates a postgres database. Here is what I find via psql:

postgres=# \l
                             List of databases
   Name    |  Owner   | Encoding  | Collate | Ctype |   Access privileges   
-----------+----------+-----------+---------+-------+-----------------------
 postgres  | postgres | SQL_ASCII | C       | C     | 
 template0 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
 template1 | postgres | SQL_ASCII | C       | C     | =c/postgres          +
           |          |           |         |       | postgres=CTc/postgres
(3 rows)

Does it need more than this? This is exactly what is there by default on a normal apt-get install postgresql. We tell it not to do the initdb so it can be done in the entrypoint (after any volume mounts).

from postgres.

bfirsh avatar bfirsh commented on June 29, 2024

Oh, cool. Is the "postgres" database empty and usable for user data?

from postgres.

yosifkit avatar yosifkit commented on June 29, 2024

No relations found. All the system data is in pg_catalogue.

from postgres.

bfirsh avatar bfirsh commented on June 29, 2024

Perfect! Could we make clear in the description that there is a user postgres without auth and a database postgres that can be used for user data?

from postgres.

yosifkit avatar yosifkit commented on June 29, 2024

Yes, we are working to make the docker hub descriptions part of the git, so that it is easier to update (with a PR). I will add it to our list to update it.

from postgres.

bfirsh avatar bfirsh commented on June 29, 2024

Perfect. Thanks @yosifkit!

from postgres.

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.