La instalación de PostgreSQL homebrew carece de archivos de configuración


21

Así que instalé con éxito PostgreSQL 9.1 en MacOSX Lion. A diferencia de la gente dice, no tuve que cambiar la RUTA y no se instaló ninguna otra versión de PostgreSQL en el sistema ( $ psql --version muestra psql (PostgreSQL) 9.1.4).

Sin embargo, cuando intento ejecutar el servidor con pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log startél no funciona. Primero, dice que no /usr/local/var/postgres/existe ningún directorio . Bien, creado uno. Luego dice que los permisos son incorrectos, está bien, los cambió. Entonces requiere que el postgresql.confarchivo esté en este directorio.

Ahora, encontré configuraciones de muestra /usr/local/Cellar/postgresql/9.1.4/share/postgresql, pero no estoy seguro de que así sea. Todos los manuales que he visto en la web no mencionaron la creación de archivos de configuración a partir de muestras. ¿No debería Homebrew proporcionar esto de forma inmediata, de modo que simplemente inicie el servidor de inmediato?


Si cree que debería hacerlo, envíe un nuevo problema ; personalmente nunca lo instalé, por lo que no puedo decir si esto es intencionado o no.
— slhck

Respuestas:


21

¿Es esta tu primera instalación? ¿Has intentado correr initdb /usr/local/var/postgres? Eso resolvió el mismo problema, que me acaba de suceder después de borrar una instalación antigua de PostgreSQL en todo el sistema y reinstalarla usando Homebrew.

La ejecución brew info postgressiempre es útil como recordatorio de los comandos disponibles después de instalar un paquete.

postgresql 9.1.4
http://www.postgresql.org/
Depends on: readline, ossp-uuid
/usr/local/Cellar/postgresql/9.1.4 (2751 files, 36M) *
https://github.com/mxcl/homebrew/commits/master/Library/Formula/postgresql.rb

==> Caveats
# Build Notes

If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
  https://github.com/mxcl/homebrew/issues/issue/2510

To build plpython against a specific Python, set PYTHON prior to brewing:
  PYTHON=/usr/local/bin/python  brew install postgresql
See:
  http://www.postgresql.org/docs/9.1/static/install-procedure.html

# Create/Upgrade a Database

If this is your first install, create a database with:
  initdb /usr/local/var/postgres

To migrate existing data from a previous major version (pre-9.1) of PostgreSQL, see:
  http://www.postgresql.org/docs/9.1/static/upgrading.html

# Start/Stop PostgreSQL

If this is your first install, automatically load on login with:
  mkdir -p ~/Library/LaunchAgents
  cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
  launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

If this is an upgrade and you already have the homebrew.mxcl.postgresql.plist loaded:
  launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
  launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Or start manually with:
  pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

And stop with:
  pg_ctl -D /usr/local/var/postgres stop -s -m fast

# Loading Extensions

By default, Homebrew builds all available Contrib extensions.  To see a list of all
available extensions, from the psql command line, run:
  SELECT * FROM pg_available_extensions;

To load any of the extension names, navigate to the desired database and run:
  CREATE EXTENSION [extension name];

For instance, to load the tablefunc extension in the current database, run:
  CREATE EXTENSION tablefunc;

For more information on the CREATE EXTENSION command, see:
  http://www.postgresql.org/docs/9.1/static/sql-createextension.html
For more information on extensions, see:
  http://www.postgresql.org/docs/9.1/static/contrib.html

# Other

Some machines may require provisioning of shared memory:
  http://www.postgresql.org/docs/current/static/kernel-resources.html#SYSVIPC

To install postgresql (and ossp-uuid) in 32-bit mode:
   brew install postgresql --32-bit

If you want to install the postgres gem, including ARCHFLAGS is recommended:
    env ARCHFLAGS="-arch x86_64" gem install pg

To install gems without sudo, see the Homebrew wiki.

Supuse que esto existía, pero no lo sabía. brew info blah. ¡Esto es fantástico! Gracias. :)
— chandsie

A partir de junio de 2014, brew info postgresya no proporciona información útil, por CREATE EXTENSIONlo que para mí fue útil verla aquí.
— user12345
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.