Re: Getting Started: user doesn't exist - Mailing list pgsql-novice

From Eric M. Cherry
Subject Re: Getting Started: user doesn't exist
Date
Msg-id 20060902133750.732609FB4B5@postgresql.org
Whole thread Raw
In response to Re: Getting Started: Tutorials/Books?  (Richard Broersma Jr <rabroersma@yahoo.com>)
Responses Re: Getting Started: user doesn't exist
List pgsql-novice
emc wrote:

> The tutorial that exists in the help file appears to focus on using
> the psql program from within a command shell.  I have failed to
> accomplish even the most basic commands in this manner; the system
> tells me that user "emc" does not exist, I do not appear able to
> create that user, and I cannot see a way to switch to a valid user.
> Meanwhile, using pgAdmin III, I appear to be able to create new
> databases and tables.

Richard replied:

> We (us on this mailing list) can assist you with getting connected
> to your database using psql. But first you will need to provide to
> with your pg_hba.conf file and the command you are using and the
> error message you receive when it fails.

I found the pg_hba.conf file in c:\Program Files\postgreSQL\8.1\data.  It
appears to contain a vast amount of text following "#" symbols (which I
gather means that the text is there for my information only, ignored by the
computer).  The only line of text that is not prefaced with "#" is this
(this is referenced as IPv4):

host     all     all     127.0.0.1/32     trust

A similar line of text below this one, referenced as IPv6, is this:

#host     all     all     ::1/128          trust

So that's the pg_hba.conf file information.  What I'm doing is this:

1.  In Windows, through the Start menu, I select "Start service"
2.  I wait for "Start service" to open and close a command shell (usually
too fast to see more than a flicker)
3.  In Windows, through the Start menu, I select "Command prompt"
4.  A command shell opens, giving me the prompt:

     C:\Program Files\PostgreSQL\8.1\bin>

5.  I type:

     C:\Program Files\PostgreSQL\8.1\bin>createdb mydb [enter]

6.  The system yields the following error:

     createdb: could not connect to database postgres: FATAL:  role "emc"
does not exist

7.  I am left back at the prompt.
8.  Not to be deterred, I type:

     C:\Program Files\PostgreSQL\8.1\bin>createuser emc

9.  The system gives me a prompt:

     Shall the new role be a superuser? (y/n)

10.  I type "y" [enter]
11.  The system yields an error message:

     createuser: could not connect to database postgres: FATAL:  role "emc"
does not exist

12.  I open Outlook and email the Novice List.

I think that it's noteworthy that pgAdmin III lets me perform the tasks of
making new databases without trouble.  This tells me that the tasks can be
done on my computer, but that I'm leaving out some basic step.  (To give you
an idea of how basic, I spent ten minutes getting the error that the port
wasn't listening.  I finally stumbled to the trick that I had to "start
service" first.  That gives you an idea of the sort of basic step I'm apt to
miss out of sheer ignorance.)

   - emc


pgsql-novice by date:

Previous
From: "Eric M. Cherry"
Date:
Subject: Re: Getting Started: Tutorials/Books?
Next
From: John Purser
Date:
Subject: Re: Getting Started: user doesn't exist