Thread: Q re installing Pg on OS X?

Q re installing Pg on OS X?

From
"Kynn Jones"
Date:
I'm trying to install PostgreSQL on my Mac laptop.

I used MacPorts for the first stage of the installation.  I did the following:

% sudo port install postresql82 +perl +python

This took quite a while to complete, but it ran without a hitch.

From that point on I followed the instructions given in


although I had to make significant modifications to their procedure (for one thing, they use Fink to install the software whereas I used MacPorts; and they refer to v. 7.4.1 as the most recent version of PostgreSQL, so the instructions are somewhat old).

Per these instructions, I created a postgres user, logged in as it, updated my PATH, started the server manually, and created a database with

% createdb test

After this point I am able to log in as the postgres user using "psql test".

But I can't log in as any othe user.  I get the errors like this one:

FATAL: role "root" does not exist

The instructions I'm following have nothing to say about "roles".  (I figure this must be a post-7.4.2 feature.)

Can someone point to more up-to-date installation instructions for OS X?

Thanks!

kj

Re: Q re installing Pg on OS X?

From
"Kynn Jones"
Date:
OK, I found the answer to my question about the "roles" error.

Still, it would be nice to have more up-to-date instructions on how to install PostgreSQL on OS X.  Any pointers would be much appreciated!

TIA!

kj

On 4/15/07, Kynn Jones <kynnjo@gmail.com> wrote:
I'm trying to install PostgreSQL on my Mac laptop.

 
I used MacPorts for the first stage of the installation.  I did the following:

% sudo port install postresql82 +perl +python

 
This took quite a while to complete, but it ran without a hitch.

From that point on I followed the instructions given in

 

although I had to make significant modifications to their procedure (for one thing, they use Fink to install the software whereas I used MacPorts; and they refer to v. 7.4.1 as the most recent version of PostgreSQL, so the instructions are somewhat old).

Per these instructions, I created a postgres user, logged in as it, updated my PATH, started the server manually, and created a database with

% createdb test

After this point I am able to log in as the postgres user using "psql test".

But I can't log in as any othe user.  I get the errors like this one:

FATAL: role "root" does not exist

The instructions I'm following have nothing to say about "roles".  (I figure this must be a post-7.4.2 feature.)

Can someone point to more up-to-date installation instructions for OS X?

Thanks!

kj

 

 

Re: Q re installing Pg on OS X?

From
Seneca Cunningham
Date:
On Sun, Apr 15, 2007 at 06:18:18PM -0400, Kynn Jones wrote:
> OK, I found the answer to my question about the "roles" error.
> Still, it would be nice to have more up-to-date instructions on how to
> install PostgreSQL on OS X.  Any pointers would be much appreciated!

Try the main documentation at:
  http://postgresql.org/docs/8.2/interactive/installation.html
  http://www.postgresql.org/docs/8.2/interactive/runtime.html

All the steps you need.

--
Seneca
tentra@gmail.com

Re: Q re installing Pg on OS X?

From
Kevin Murphy
Date:
Seneca Cunningham wrote:
> On Sun, Apr 15, 2007 at 06:18:18PM -0400, Kynn Jones wrote:
>
>> Still, it would be nice to have more up-to-date instructions on how to
>> install PostgreSQL on OS X.  Any pointers would be much appreciated!
>>
>
> Try the main documentation
And just for the record, PostgreSQL compiles and installs smoothly from
source code when you have XCode (developer tools) installed, using the
instructions in the INSTALL file in the tar ball.

Notes:
*) Use 'make' instead of 'gmake' as indicated (OS X make is GNU make)
*) OS X doesn't have an 'adduser' command

Either use the GUI or create a postgres user on the command line using
niload, e.g.:

sudo niload group . <<EOF
postgres:*:5432:
EOF

sudo niload passwd . <<EOF
postgres:*:5432:5432::0:0:postgresql superuser:/var/empty:/usr/bin/false
EOF

where 5432 is the user id and group id you are assigning (check
availability with 'nidump group .' and 'nidump passwd .').

This assumes you are an admin user (in the admin group), so you can run
'sudo'.

The resulting postgres account is not a login account.

When you need to do things under the identity of the postgres superuser,
you can issue commands like this:

sudo -u postgres somecommand ...

It's not hard to create a suitable startup item under
/Library/StartupItems/ to make sure PG starts automatically and to make
it easy to bring it up and down when you have to.

-Kevin