Vao Tsun Vao Tsun In short: Postgres groups databases into "clusters", each of which is a named collection of databases sharing a configuration and data location, and running on a single server instance with its own TCP port. If you only want a single instance of Postgres, the installation includes a cluster named "main", so you don't need to run initdb to create one.
David Scarlett David Scarlett 2, 2 2 gold badges 9 9 silver badges 27 27 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Does ES6 make JavaScript frameworks obsolete? Podcast Do polyglots have an edge when it comes to mastering programming Peter Eisentraut Peter Eisentraut 1, 11 11 silver badges 8 8 bronze badges. This really should be the accepted answer.
Still, if you find yourself in need of recreating a cluster quickly and don't want to bother with reinstalling postgres or if you need to initialise a new database in a non-standard location this may come in handy. So yes, this is a great answer. And it's the best because this way I can be sure which version I'm using. After installing postgresql you can do: sudo su - postgres Then you should be able to run initdb.
Myers Brian. Myers 8 8 silver badges 16 16 bronze badges. Since merely installing postgresql-X. Even after switching to the postgres user I still get this error — Cogwheel. This doesn't work for me in Ubuntu Server 14 using Postgres 9. EAmez 5 5 bronze badges.
This answer does not address the question directly at all. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Create a free Team What is Teams? Learn more. Where is initdb in Ubuntu Ask Question. Asked 10 years, 9 months ago. Active 10 years, 9 months ago. Viewed 11k times.
Does anyone know how this is supposed to be done on Ubuntu? Improve this question. John Lawrence Aspden John Lawrence Aspden 2, 3 3 gold badges 15 15 silver badges 12 12 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. For server software this is absolutely ass-backwards. I decide where my database data files go, not Ubuntu's overzealous re-packagers.
This kind of nonsense is Exhibit A for not ever running a server on Ubuntu.
0コメント