Re: Total Newbie: Trouble installing postgresSQL on OS X Snow Leopard

Поиск
Список
Период
Сортировка
От Brent Dombrowski
Тема Re: Total Newbie: Trouble installing postgresSQL on OS X Snow Leopard
Дата
Msg-id 0655DB83-5D03-4ABC-B166-E93256CA2312@gmail.com
обсуждение исходный текст
Ответ на Total Newbie: Trouble installing postgresSQL on OS X Snow Leopard  (Kevin Goulding <kevingoulding@gmail.com>)
Список pgsql-novice
On Jan 26, 2012, at 10:22 AM, Kevin Goulding wrote:

> Hi all, I am trying to get set up with a database in PostgresSQL and
> eventually postGIS, so followed the install instructions on Kyng Chaos' web
> site:
> http://www.kyngchaos.com/software:postgres
>
> (I installed all of the items in the list with the exception of "PostgreSQL
> Client-only 9.1.2-1").  Then I entered the Terminal, and went through the
> following, with little luck.  Can anyone help or point me in the right
> direction to get a new database set up?
>
>>> My suspicion is that the problem lies in the line (below) where it says:
>
> *initdb: could not access directory "/usr/local/pgsql-9.1/data": Permission
> denied*
>
> Many thanks!
> Kevin
>

The data folder (/usr/local/pgsql-9.1/data) is typically owned by the user "postgres". In order to access that
directory,you need to be the postgres user. 

I've always done the database initialization as postgres:
$ sudo -u postgres /usr/local/pgsql-9.1/bin/initdb -D /usr/local/pgsql-9.1/data --encoding=UTF8 --local=en_us

>
>>> My system:  OS X 10.6.8 Snow Leopard
>>> First, I tried to create a new data base called "db1":
>
> kevin-gouldings-imac:~ kevingoulding$ /usr/local/pgsql/bin/psql -U postgres
> -d db1 -f /usr/local/pgsql/share/contrib/postgis-1.5/postgis.sql
> psql: FATAL:  database "db1" does not exist

This does not create a database. It's trying to connect to an existing database (db1) and run the postgis script. If
youhaven't installed postgis yet, that script will fail as well. 

Postgres creates a database called postgres. Try the following:
$ /usr/local/pgsql-9.1/bin/psql -P postgres -d postgres
If that gets a postgres prompt, then initdb was successful and you are up and running.

Chapter 15 of the manual has lots of details on installing postgres
http://www.postgresql.org/docs/9.1/interactive/installation.html



В списке pgsql-novice по дате отправления:

Предыдущее
От: Kevin Goulding
Дата:
Сообщение: Total Newbie: Trouble installing postgresSQL on OS X Snow Leopard
Следующее
От: Rob Richardson
Дата:
Сообщение: Order of update triggers