Discussion:
pgsql initial superuser
(too old to reply)
Pedro Almeida
2004-02-16 17:24:15 UTC
Permalink
Hello. this is my "first" time using pgsql, and I seem to be running to
a bit of a corner here :-)

I've understood how to add a superuser/database-user/user but I have no
user to begin with.

~# createuser superuser
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
psql: FATAL: user "root" does not exist
createuser: creation of user "superuser" failed

So I need someway to add a user so I can add others. I belive this is
done in the pg_hba.conf file, but so far I've been unlucky. I'm using
the debian distributed pg_hba.conf file set up for local access, and I
tried the following lines, each a complete failure:

pg_hba.conf
<snip>
local all root md5
#OR
#local all root ident
<snip>

Even with "createuser blabla -Uroot -W" and using the "ident" auth
method fails. What am I missing here?

Thank you for the support :-D


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Pedro Almeida
2004-02-16 18:43:23 UTC
Permalink
try user 'pgsql' :) that's the default initially created superuser, no
password (it would be good to give it one).
-kaolin fire
-http://erif.org/code/fallingup/ for a 'spin' on tetris
That was a quick response :-)

using a clean pg_hba.conf file (no user lines added), this is what happened:

*******
~# createuser -Upgsql
Enter name of user to add: blabla
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
psql: FATAL: IDENT authentication failed for user "pgsql"

createuser: creation of user "blabla" failed
*******

What am I doing wrong ?

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match
Gémes Géza
2004-02-16 19:48:23 UTC
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pedro Almeida írta:
| kaolin fire wrote:
|
|> try user 'pgsql' :) that's the default initially created superuser, no
|> password (it would be good to give it one).
|>
|> -kaolin fire
|> -http://erif.org/code/fallingup/ for a 'spin' on tetris
|>
|>
| That was a quick response :-)
|
| using a clean pg_hba.conf file (no user lines added), this is what
| happened:
|
| *******
| ~# createuser -Upgsql
| Enter name of user to add: blabla
| Shall the new user be allowed to create databases? (y/n) n
| Shall the new user be allowed to create more new users? (y/n) n
| psql: FATAL: IDENT authentication failed for user "pgsql"
|
| createuser: creation of user "blabla" failed
| *******
|
| What am I doing wrong ?
|
| ---------------------------(end of broadcast)---------------------------
| TIP 9: the planner will ignore your desire to choose an index scan if your
| joining column's datatypes do not match

Add a line:
local all all ident sameuser
to your pg_hba.conf
restart postgresql
find out under what userid is your postgresql running typicaly it would
be postgres, I'll supose that it is postgres:
su postgres
and do whatever you like with your database cluster.
Because of this I would suggest as a first step to do:
psql template1
SQL commands follow:
ALTER USER postgres password='SomeReallyBigSecretHere' ;

Hope it helps.

Cheers,

Geza
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAMR6G/PxuIn+i1pIRAoaAAKCBALjM0r1nQ3K8anMwrDh/BGscOgCggs18
V+YlMMBEGys7jd7LzfV5M0Y=
=udMf
-----END PGP SIGNATURE-----


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Peter Eisentraut
2004-02-16 20:09:32 UTC
Permalink
Post by Pedro Almeida
So I need someway to add a user so I can add others.
There should be a predefined user named "postgres".


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Pedro Almeida
2004-02-16 20:51:27 UTC
Permalink
That was it - user 'postgres', owner of postmaster, has got what it takes.

Thank you for solving my problem and giving me some extra tips to work on.

I will now continue lurking on the ML and watching closely your
discussions. Good bye then :-)



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
V i s h a l Kashyap @ [Sai Hertz And Control Systems]
2004-06-03 12:21:35 UTC
Permalink
Dear Pedro ,
Post by Pedro Almeida
Hello. this is my "first" time using pgsql, and I seem to be running
to a bit of a corner here :-)
I've understood how to add a superuser/database-user/user but I have
no user to begin with.
~# createuser superuser
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
psql: FATAL: user "root" does not exist
createuser: creation of user "superuser" failed
If you have compiled PostgreSQL then the user login used for initdb is
the default user
else
this was from rpm then postgres is the super user
you may login as

psql -U postgres template1
--
Regards,
Vishal Kashyap
Director / Lead Software Developer,
Sai Hertz And Control Systems Pvt Ltd,
http://saihertz.rediffblogs.com
Jabber IM: vishalkashyap[ a t ]jabber.org
ICQ : 264360076
Yahoo IM: mailforvishal[ a t ]yahoo.com
-----------------------------------------------
You yourself, as much as anybody in the entire
universe, deserve your love and affection.
- Buddha
---------------
pgsql=# select marital_status from vishals_life;

marital_status
------------------
Single not looking

1 Row(s) affected



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Loading...