newbie question

Tena Sakai sakaitena at yahoo.com
Tue May 3 18:27:26 PDT 2011


Hi Daniel,
Hi Ryan and Mark,

When I try what you mention ("psql -U postgres postgres")
here's what happens:
   $ /opt/local/lib/postgresql90/bin/psql -U postgres postgres
   Password for user postgres: 
   psql: FATAL:  password authentication failed for user "postgres"

I gave "trust" as you
 suggested.

Clearly the account postgres exists.  (Because I can su to it
from being root.)  But on this incarnation of the OS (snow
leopard, 10.6.7), one is supposed to manage password
changes via Accounts (in System Preferences). 
 And
according to Accounts, there is no such user as postgres.
Curiously, it does show the group postgres.

I have looked at the passwd file via vipw and postgres doesn't
exist in it.  So, where is the account postgres?

Here's something else kinda strange:
   $ echo ~postgres
   /Applications/postgres
   $ ls -ld /Applications/postgres
   ls: /Applications/postgres: No such file or directory

At this point, I went back to Accounts (via System Preferences)
and looked at group postgres.  And I saw my account is shown
in membership panel and there is a box for check mark next to
it, which was unchecked.  I checked it and got out of the Accounts
and rerun psql command as before:
   $ psql -U postgres postgres
   psql (9.0.4)
   Type "help" for help.

   postgres=# \q

Bingo!  it
 doesn't ask password anymore!
Now I can go ahead to create database of my choice and populate
tables, it seems.

Many thanks for your suggestions and replies.

Regards,

Tena


--- On Tue, 5/3/11, Daniel J. Luke <dluke at geeklair.net> wrote:

From: Daniel J. Luke <dluke at geeklair.net>
Subject: Re:
 newbie question
To: "MacPorts Users" <macports-users at lists.macosforge.org>
Date: Tuesday, May 3, 2011, 3:56 PM

On May 3, 2011, at 6:43 PM, Mark Hattam wrote:
> 
> On 3 May 2011, at 23:25, Ryan Schmidt wrote:
>> On May 3, 2011, at 00:12, Tena Sakai wrote:
>>> Having installed it, the first thing I want to do is to run
>>> 'psql postgres' command.  When I do this, it asks me
>>> postgres user password.  I have no idea what that is
>>> (I think maybe macport created postgres user?).  

If 'psql postgres' is asking you for a password, it's asking you for your password to access the postgres database (you can change how postgres does authentication - it's pretty flexible). 

I think the default config uses 'trust' authentication, so you can do something like:

psql -U postgres postgres

and you'll
 connect as
 the database super-user (postgres) to the database named 'postgres'.

>>> When
>>> I use "Accounts" from System Preferences it shows no
>>> such user as postgres.  However, I can become root
>>> and then issue 'su postgres' command and strangely
>>> enough I am indeed user postgres.
>>> 
>>> Can you please give me a tip as to how to reset password
>>> for user postgres?

root can change any system user's account passsword ('sudo passwd postgres'), but that probably won't do what you want.

I would recommend that you don't set a password for the 'postgres' system account.

> ... which of course isn't in my $PATH as it's in
> /opt/local/lib/postgresql84/bin/
> so why it's tucked away someother other than
> /opt/local/bin
> I don't know

so that you can have multiple versions of postgres installed at the
 same time.

--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+         
               
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+



_______________________________________________
macports-users mailing list
macports-users at lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110503/30d347c7/attachment.html>


More information about the macports-users mailing list