Re: PostGreSQL - Accessing It

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: Mel Roman <mel(at)melroman(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostGreSQL - Accessing It
Date: 2003-08-15 02:06:48
Message-ID: Pine.GSU.4.44.0308141905280.22052-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You haven't created a user. Create User is a postgresql statement, and
must be terminated w/ a colon. I don't think your syntax is right either.
You \q'd before your statement was complete.

However, it's even eeasier to do create user from the command line (i.e.
NOT in psql mode, but still as user postgres)

createuser mel

Do this from the _shell_ prompt not the postgresql prompt.

Jon

On Thu, 14 Aug 2003, Mel Roman wrote:

> In article <20030813043808(dot)A15117(at)laokoon(dot)bug(dot)net>, Thomas Beutin wrote:
> >> I have the same problem as Michael. I've installed postgresql and am
> >> running the service, but I can't log in as postgres. I just tried the
> >> command line "psql -U postgres template1", but I get the message
> >> "authentication failed for user 'postgres'". The administrator's manual
> >> confirms that I first need to connect as this predefined user, but
> >> doesn't say what that user's password is.
> > Did You tried "su - postgres" as root? This should bring You into a
> > shell of the postgres user.
>
> Thanks for your response. Sorry for not getting back to you guys sooner
> (I was away).
>
> I've changed the password for postgres now and am able to successfully
> get into psql as postgres. I'm now having problems adding myself as a
> user. After reading the admininstrator's manual I connected as postgres
> and did a CREATE USER add myself as a user. When I then try to connect
> as myself ("mel"), psql tells me that I'm not set up as a user. I've
> copied my session below for clarity. What am I doing wrong?
>
> [mel(at)Cr168131-a mel]$ su postgres
> Password:
> bash-2.05b$ psql test
> Welcome to psql, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help on internal slash commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> test=# CREATE USER mel CREATEDB
> test-# \q
> bash-2.05b$ exit
> exit
> [mel(at)Cr168131-a mel]$ psql test
> psql: FATAL 1: user "mel" does not exist
>
> --
>
> Mel Roman
> mel(at)melroman(dot)net
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew L. Gould 2003-08-15 02:12:29 Re: PostGreSQL - Accessing It
Previous Message Thomas A. Lowery 2003-08-15 01:38:00 Re: Simple DBI question.