role does not exist

Started by Kevin Burtonover 13 years ago47 messagesgeneral
Jump to latest
#1Kevin Burton
rkevinburton@charter.net

I have successfully installed PostgreSQL on a Ubuntu Linux machine. However
right off the bat I type 'psql' and I get the error: 'role "xxxx" does not
exist'. Where xxx is the user name logged in. How do I overcome this hurdle.
Right now all of our data is on a Windows SQL Server. Can someone give me
step by step directions on how to import the databases from SQL Server.
Actually I only want a few tables in the database. Hints?

Thank you.

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#1)
Re: role does not exist

On 10/31/2012 03:54 PM, Kevin Burton wrote:

I have successfully installed PostgreSQL on a Ubuntu Linux machine.
However right off the bat I type �psql� and I get the error: �role
�xxxx� does not exist�. Where xxx is the user name logged in. How do I
overcome this hurdle. Right now all of our data is on a Windows SQL
Server. Can someone give me step by step directions on how to import the
databases from SQL Server. Actually I only want a few tables in the
database. Hints?

http://www.postgresql.org/docs/9.2/interactive/app-psql.html

Usage

Connecting to a Database

"The default user name is your Unix user name, as is the default
database name.

To specify a user other than your system user name:

"
-U username
--username=username
Connect to the database as the user username instead of the default.
(You must have permission to do so, of course.)"

This assumes you have that user set up. Otherwise see:

http://www.postgresql.org/docs/9.2/interactive/app-createuser.html

Thank you.

--
Adrian Klaver
adrian.klaver@gmail.com

#3Joshua D. Drake
jd@commandprompt.com
In reply to: Kevin Burton (#1)
Re: role does not exist

On 10/31/2012 03:54 PM, Kevin Burton wrote:

I have successfully installed PostgreSQL on a Ubuntu Linux machine.
However right off the bat I type ‘psql’ and I get the error: ‘role
“xxxx” does not exist’. Where xxx is the user name logged in. How do I
overcome this hurdle. Right now all of our data is on a Windows SQL
Server. Can someone give me step by step directions on how to import the
databases from SQL Server. Actually I only want a few tables in the
database. Hints?

Well step by step is a bit exhaustive for a mailing list. To solve the
specific question the default user is postgres and the default super
user within postgresql is postgres. Try this:

sudo -u postgres psql

JD

Thank you.

--
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Support, Training, Professional Services and Development
High Availability, Oracle Conversion, Postgres-XC
@cmdpromptinc - 509-416-6579

#4Kevin Burton
rkevinburton@charter.net
In reply to: Joshua D. Drake (#3)
Re: role does not exist

I tried this and I get an error that

'psql: FATAL: role "postgres" does not exist'

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Joshua D. Drake
Sent: Wednesday, October 31, 2012 6:33 PM
To: Kevin Burton
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 10/31/2012 03:54 PM, Kevin Burton wrote:

I have successfully installed PostgreSQL on a Ubuntu Linux machine.
However right off the bat I type 'psql' and I get the error: 'role
"xxxx" does not exist'. Where xxx is the user name logged in. How do I
overcome this hurdle. Right now all of our data is on a Windows SQL
Server. Can someone give me step by step directions on how to import
the databases from SQL Server. Actually I only want a few tables in
the database. Hints?

Well step by step is a bit exhaustive for a mailing list. To solve the
specific question the default user is postgres and the default super user
within postgresql is postgres. Try this:

sudo -u postgres psql

JD

Thank you.

--
Command Prompt, Inc. - http://www.commandprompt.com/ PostgreSQL Support,
Training, Professional Services and Development High Availability, Oracle
Conversion, Postgres-XC @cmdpromptinc - 509-416-6579

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#4)
Re: role does not exist

On 10/31/2012 06:01 PM, Kevin Burton wrote:

I tried this and I get an error that

'psql: FATAL: role "postgres" does not exist'

What is the content of /etc/postgresql/pg_hba.conf?

--
Adrian Klaver
adrian.klaver@gmail.com

#6Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#5)
Re: role does not exist

What am I looking for? It is full of comments. If I am looking at the lines
that don't begin with '#' I only see all and postgres as users.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Adrian Klaver
Sent: Wednesday, October 31, 2012 8:42 PM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 10/31/2012 06:01 PM, Kevin Burton wrote:

I tried this and I get an error that

'psql: FATAL: role "postgres" does not exist'

What is the content of /etc/postgresql/pg_hba.conf?

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Craig Ringer
craig@2ndquadrant.com
In reply to: Kevin Burton (#1)
Re: role does not exist

On 11/01/2012 06:54 AM, Kevin Burton wrote:

I have successfully installed PostgreSQL on a Ubuntu Linux machine.
However right off the bat I type 'psql' and I get the error: 'role
"xxxx" does not exist'.

As with most Ubuntu packages, there's documentation on post-install
setup steps in /usr/share/doc/[packagename]/README.Debian.gz. See:

zless /usr/share/doc/postgresql-?.?/README.Debian.gz

--
Craig Ringer

#8Kevin Burton
rkevinburton@charter.net
In reply to: Craig Ringer (#7)
Re: role does not exist

Sorry there isn't a README.Debian.gz in the postgresql-doc-9.1. There is a
changelog.Debian.gz but that doesn't seem to address this problem.

From: Craig Ringer [mailto:ringerc@ringerc.id.au]
Sent: Thursday, November 01, 2012 12:33 AM
To: Kevin Burton
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:54 AM, Kevin Burton wrote:

I have successfully installed PostgreSQL on a Ubuntu Linux machine. However
right off the bat I type 'psql' and I get the error: 'role "xxxx" does not
exist'.

As with most Ubuntu packages, there's documentation on post-install setup
steps in /usr/share/doc/[packagename]/README.Debian.gz. See:

zless /usr/share/doc/postgresql-?.?/README.Debian.gz

--
Craig Ringer

#9Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#5)
Re: role does not exist

There is a tutorial directory but it has a README that I need to type 'make'
to view the files. Well, make wasn't available so I installed 'make' with
apt-get. Then I was met with an error apparently from the Makefile that
pg_conf: command not found. I seem to be getting farther and farther from
the original question, that of role "postgres" does not exist.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Adrian Klaver
Sent: Wednesday, October 31, 2012 8:42 PM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 10/31/2012 06:01 PM, Kevin Burton wrote:

I tried this and I get an error that

'psql: FATAL: role "postgres" does not exist'

What is the content of /etc/postgresql/pg_hba.conf?

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#10Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#9)
Re: role does not exist

On 11/01/2012 05:02 AM, Kevin Burton wrote:

There is a tutorial directory but it has a README that I need to type 'make'
to view the files. Well, make wasn't available so I installed 'make' with
apt-get. Then I was met with an error apparently from the Makefile that
pg_conf: command not found. I seem to be getting farther and farther from
the original question, that of role "postgres" does not exist.

I just tested an install of Postgres on Ubuntu and sudo -u postgres psql
worked just fine.

Are you sure you installed all of the Postgres packages?
What does dpkg -l| grep postgresql show?
Is Postgres is running?
What does ps ax| grep postgresql show?

--
Adrian Klaver
adrian.klaver@gmail.com

#11Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#10)
Re: role does not exist

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

I still get ' psql: FATAL: role "postgres" does not exist' when I execute
'sudo -u postgres psql'.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Adrian Klaver
Sent: Thursday, November 01, 2012 8:24 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 05:02 AM, Kevin Burton wrote:

There is a tutorial directory but it has a README that I need to type

'make'

to view the files. Well, make wasn't available so I installed 'make'
with apt-get. Then I was met with an error apparently from the
Makefile that
pg_conf: command not found. I seem to be getting farther and farther
from the original question, that of role "postgres" does not exist.

I just tested an install of Postgres on Ubuntu and sudo -u postgres psql
worked just fine.

Are you sure you installed all of the Postgres packages?
What does dpkg -l| grep postgresql show?
Is Postgres is running?
What does ps ax| grep postgresql show?

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#12Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#11)
Re: role does not exist

On 11/01/2012 06:38 AM, Kevin Burton wrote:

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

Please show the actual output from the ps command.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

#13Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#12)
Re: role does not exist

I am having a hard time with the clipboard so I will reproduce the output as
best as I can:

2066 tty1 S+ 0:00 grep --color=auto postgresql

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, November 01, 2012 8:42 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:38 AM, Kevin Burton wrote:

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

Please show the actual output from the ps command.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

#14Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Kevin Burton (#13)
Re: role does not exist

Adrian Klaver wrote:

What does ps ax| grep postgresql show?

Are you sure you don't want this?:

 ps ax | grep postgres

-Kevin

#15Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#13)
Re: role does not exist

On 11/01/2012 06:45 AM, Kevin Burton wrote:

I am having a hard time with the clipboard so I will reproduce the output as
best as I can:

2066 tty1 S+ 0:00 grep --color=auto postgresql

So Postgres is not actually running. What you are seeing is the grep command.
If it where running you would see something like:

29041 ? S 0:01 /usr/lib/postgresql/8.4/bin/postgres -D /var/lib/postgresql/8.4/main -c config_file=/etc/postgresql/8.4/main/postgresql.conf

Try:

sudo /etc/init.d/postgresql-9.1 start

This should start Postgres.

Then do:

sudo -u postgres psql

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, November 01, 2012 8:42 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:38 AM, Kevin Burton wrote:

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

Please show the actual output from the ps command.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

#16Kevin Burton
rkevinburton@charter.net
In reply to: Kevin Burton (#13)
Re: role does not exist

If you change the grep to postgres then there are a number of entries (about
17). The output since I don't have a clipboard is too much to try and type
in by hand.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Kevin Burton
Sent: Thursday, November 01, 2012 8:45 AM
To: 'Adrian Klaver'
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

I am having a hard time with the clipboard so I will reproduce the output as
best as I can:

2066 tty1 S+ 0:00 grep --color=auto postgresql

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, November 01, 2012 8:42 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:38 AM, Kevin Burton wrote:

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

Please show the actual output from the ps command.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#17Chris Angelico
rosuav@gmail.com
In reply to: Kevin Burton (#16)
Re: role does not exist

On Fri, Nov 2, 2012 at 12:51 AM, Kevin Burton <rkevinburton@charter.net> wrote:

If you change the grep to postgres then there are a number of entries (about
17). The output since I don't have a clipboard is too much to try and type
in by hand.

Try this:

ps ax| grep postgresql >processes.txt

Then open processes.txt in an editor. You may be able to use the
clipboard more easily that way.

ChrisA

#18Chris Angelico
rosuav@gmail.com
In reply to: Chris Angelico (#17)
Re: role does not exist

On Fri, Nov 2, 2012 at 12:56 AM, Chris Angelico <rosuav@gmail.com> wrote:

On Fri, Nov 2, 2012 at 12:51 AM, Kevin Burton <rkevinburton@charter.net> wrote:

If you change the grep to postgres then there are a number of entries (about
17). The output since I don't have a clipboard is too much to try and type
in by hand.

Try this:

ps ax| grep postgresql >processes.txt

Then open processes.txt in an editor. You may be able to use the
clipboard more easily that way.

And per the other posts, change postgresql to postgres for more useful
results. But you already knew that. :)

ChrisA

#19Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#16)
Re: role does not exist

On 11/01/2012 06:51 AM, Kevin Burton wrote:

If you change the grep to postgres then there are a number of entries (about
17). The output since I don't have a clipboard is too much to try and type
in by hand.

If you are seeing the above in a terminal then use the mouse to select
the area and then right click and select copy.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

#20Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#15)
Re: role does not exist

I do see actually three lines with a -D in it that may be similar:

1166 ? S 0:01 /usr/bin/postgres -C -D /var/lib/postgres-xc/coord
1214 ? S 0:01 /usr/bin/postgres -X -D /var/lib/postgres-xc/datanode1
1233 ? S 0:01 /usr/bin/postgres -X -D /var/lib/postgres-xc/datanode2

There are a number of entries of the form:

1185 ? Ss 0:10 postgres: pooler process

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, November 01, 2012 8:52 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:45 AM, Kevin Burton wrote:

I am having a hard time with the clipboard so I will reproduce the
output as best as I can:

2066 tty1 S+ 0:00 grep --color=auto postgresql

So Postgres is not actually running. What you are seeing is the grep
command.
If it where running you would see something like:

29041 ? S 0:01 /usr/lib/postgresql/8.4/bin/postgres -D
/var/lib/postgresql/8.4/main -c
config_file=/etc/postgresql/8.4/main/postgresql.conf

Try:

sudo /etc/init.d/postgresql-9.1 start

This should start Postgres.

Then do:

sudo -u postgres psql

-----Original Message-----
From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
Sent: Thursday, November 01, 2012 8:42 AM
To: Kevin Burton
Cc: 'Joshua D. Drake'; pgsql-general@postgresql.org
Subject: Re: [GENERAL] role does not exist

On 11/01/2012 06:38 AM, Kevin Burton wrote:

Dpkg -l | grep postgresql shows
postgresql-9.1
postgresql-common
postgresql-client-common
postgresql-doc
postgresql-doc-9.1
Ps -ax | grep postgresql shows
Postgresql

Please show the actual output from the ps command.

--
Adrian Klaver
adrian.klaver@gmail.com

--
Adrian Klaver
adrian.klaver@gmail.com

#21Kevin Burton
rkevinburton@charter.net
In reply to: Chris Angelico (#17)
#22Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#19)
#23Kevin Burton
rkevinburton@charter.net
In reply to: Kevin Grittner (#14)
#24Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#20)
#25Chris Angelico
rosuav@gmail.com
In reply to: Kevin Burton (#21)
#26Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#24)
#27Kevin Burton
rkevinburton@charter.net
In reply to: Chris Angelico (#25)
#28Chris Angelico
rosuav@gmail.com
In reply to: Kevin Burton (#27)
#29Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#26)
#30Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#29)
#31Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#30)
#32Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#31)
#33Kevin Burton
rkevinburton@charter.net
In reply to: Chris Angelico (#18)
#34Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#32)
#35Kevin Burton
rkevinburton@charter.net
In reply to: Adrian Klaver (#34)
#36Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Kevin Burton (#35)
#37Prashanth Kumar
prashanthk@hotmail.com
In reply to: Kevin Burton (#35)
#38Kevin Burton
rkevinburton@charter.net
In reply to: Kevin Grittner (#36)
#39Vincent Veyron
vv.lists@wanadoo.fr
In reply to: Kevin Burton (#35)
#40Kevin Burton
rkevinburton@charter.net
In reply to: Chris Angelico (#28)
#41Chris Angelico
rosuav@gmail.com
In reply to: Kevin Burton (#40)
#42Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Kevin Burton (#40)
#43Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Chris Angelico (#41)
#44Chris Angelico
rosuav@gmail.com
In reply to: Adrian Klaver (#43)
#45Craig Ringer
craig@2ndquadrant.com
In reply to: Kevin Burton (#38)
#46Kevin Burton
rkevinburton@charter.net
In reply to: Craig Ringer (#45)
#47Craig Ringer
craig@2ndquadrant.com
In reply to: Kevin Burton (#46)